Fix issue with slice expressions not being visited or printed

This commit is contained in:
Hackerpilot 2014-02-17 21:01:49 -08:00
parent 5f5a10b8fa
commit e6c83354e5
2 changed files with 12 additions and 10 deletions

View File

@ -1050,18 +1050,20 @@ class XMLPrinter : ASTVisitor
override void visit(SliceExpression sliceExpression) override void visit(SliceExpression sliceExpression)
{ {
output.writeln("<sliceExpression>"); output.writeln("<sliceExpression>");
if (sliceExpression.unaryExpression is null) visit(sliceExpression.unaryExpression);
if (sliceExpression.lower !is null)
{ {
output.writeln("<low"); output.writeln("<low>");
visit(sliceExpression.lower); visit(sliceExpression.lower);
output.writeln("</low"); output.writeln("</low>");
output.writeln("<high");
visit(sliceExpression.upper);
output.writeln("</high");
} }
else if (sliceExpression.upper !is null)
visit(sliceExpression.unaryExpression); {
output.writeln("<sliceExpression>"); output.writeln("<high>");
visit(sliceExpression.upper);
output.writeln("</high>");
}
output.writeln("</sliceExpression>");
} }
override void visit(Statement statement) override void visit(Statement statement)

View File

@ -2741,7 +2741,7 @@ public:
mixin (visitIfNotNull!(primaryExpression, newExpression, mixin (visitIfNotNull!(primaryExpression, newExpression,
deleteExpression, castExpression, functionCallExpression, argumentList, deleteExpression, castExpression, functionCallExpression, argumentList,
unaryExpression, type, identifierOrTemplateInstance, assertExpression, unaryExpression, type, identifierOrTemplateInstance, assertExpression,
indexExpression)); sliceExpression, indexExpression));
} }
/** */ Type type; /** */ Type type;