File tree 1 file changed +10
-10
lines changed
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -19,20 +19,20 @@ import codingstandards.cpp.standardlibrary.FileAccess
19
19
20
20
class PrettyPrintExpr extends Expr {
21
21
PrettyPrintExpr ( ) {
22
- this instanceof BinaryOperation
23
- or
24
- this instanceof Literal
22
+ exists ( FOpenCall fopen | this .getParent * ( ) = fopen .getMode ( ) ) and
23
+ (
24
+ this instanceof BinaryOperation
25
+ or
26
+ this instanceof Literal
27
+ )
25
28
}
26
29
}
27
30
28
- string prettyPrint ( Expr e ) {
29
- result = PrintExpr< PrettyPrintExpr > :: print ( e )
30
- }
31
-
32
- from FOpenCall fopen
31
+ from FOpenCall fopen , string modeStr
33
32
where
34
33
not isExcluded ( fopen , IO5Package:: fopenWithNonExclusiveFileCreationModeQuery ( ) ) and
35
34
fopen .mayCreate ( ) and
36
- not fopen .isExclusiveMode ( )
35
+ not fopen .isExclusiveMode ( ) and
36
+ modeStr = PrintExpr< PrettyPrintExpr > :: print ( fopen .getMode ( ) )
37
37
select fopen ,
38
- "Call to create file with non-exclusive creation mode '" + prettyPrint ( fopen . getMode ( ) ) + "'."
38
+ "Call to create file with non-exclusive creation mode '" + modeStr + "'."
You can’t perform that action at this time.
0 commit comments