Skip to content

Commit a8a7519

Browse files
committed
Disabled problem node printing by default
1 parent e9549da commit a8a7519

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/lang/cpp/internal/Parser.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ public class Parser extends ASTVisitor {
218218
private BindingsResolver br = new BindingsResolver();
219219
private TypeResolver tr;
220220

221+
boolean doProblemLogging = false;
222+
221223
public Parser(IValueFactory vf) {
222224
super(true);
223225
this.shouldVisitAmbiguousNodes = true;
@@ -2396,7 +2398,8 @@ public int visit(IASTLiteralExpression expression) {
23962398
public int visit(IASTProblemExpression expression) {
23972399
ISourceLocation loc = getSourceLocation(expression);
23982400
IASTProblem problem = expression.getProblem();
2399-
err("ProblemExpression " + expression.getRawSignature() + ":" + problem.getMessageWithLocation());
2401+
if (doProblemLogging)
2402+
err("ProblemExpression " + expression.getRawSignature() + ":" + problem.getMessageWithLocation());
24002403
stack.push(builder.Expression_problemExpression(loc));
24012404
return PROCESS_ABORT;
24022405
}
@@ -2809,11 +2812,13 @@ public int visit(IASTNullStatement statement) {
28092812
}
28102813

28112814
public int visit(IASTProblemStatement statement) {
2812-
err("IASTProblemStatement:");
2813-
prefix += 4;
2814-
err(statement.getProblem().getMessageWithLocation());
2815-
err(statement.getRawSignature());
2816-
prefix -= 4;
2815+
if (doProblemLogging) {
2816+
err("IASTProblemStatement:");
2817+
prefix += 4;
2818+
err(statement.getProblem().getMessageWithLocation());
2819+
err(statement.getRawSignature());
2820+
prefix -= 4;
2821+
}
28172822
stack.push(builder.Statement_problem(statement.getRawSignature(), getSourceLocation(statement)));
28182823
return PROCESS_ABORT;
28192824
}

0 commit comments

Comments
 (0)