Merge pull request #46 from eco/empty-for-init
Fix --ast crash on empty 'for' init decl/statement
This commit is contained in:
commit
2cc5152a68
|
@ -464,9 +464,12 @@ class XMLPrinter : ASTVisitor
|
|||
override void visit(ForStatement forStatement)
|
||||
{
|
||||
output.writeln("<forStatement>");
|
||||
output.writeln("<initialize>");
|
||||
visit(forStatement.declarationOrStatement);
|
||||
output.writeln("</initialize>");
|
||||
if (forStatement.declarationOrStatement !is null)
|
||||
{
|
||||
output.writeln("<initialize>");
|
||||
visit(forStatement.declarationOrStatement);
|
||||
output.writeln("</initialize>");
|
||||
}
|
||||
if (forStatement.test !is null)
|
||||
{
|
||||
output.writeln("<test>");
|
||||
|
|
Loading…
Reference in New Issue