From 18800b7832a6b10c9a0a4e73dcfd1f2659472615 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Fri, 25 Apr 2014 13:22:56 -0700 Subject: [PATCH 1/4] Fix assoc array parsing --- std/d/parser.d | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/std/d/parser.d b/std/d/parser.d index 13aa955..d6a80ed 100644 --- a/std/d/parser.d +++ b/std/d/parser.d @@ -325,7 +325,7 @@ alias core.sys.posix.stdio.fileno fileno; * Parses an ArrayLiteral * * $(GRAMMAR $(RULEDEF arrayLiteral): - * $(LITERAL '[') ($(RULE assignExpression) ($(LITERAL ',') $(RULE assignExpression))*)? $(LITERAL ']') + * $(LITERAL '[') $(RULE argumentList)? $(LITERAL ']') * ;) */ ArrayLiteral parseArrayLiteral() @@ -6258,8 +6258,7 @@ protected: auto b = setBookmark(); scope(exit) goToBookmark(b); advance(); - Expression e = parseExpression(); - return e !is null && currentIs(tok!":"); + return !currentIs(tok!"]") && parseExpression() !is null && currentIs(tok!":"); } bool hasMagicDelimiter(alias L, alias T)() From 7e6c84f7a1993cfcf4689f25c3d73192a0c4d615 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sat, 26 Apr 2014 23:53:42 -0700 Subject: [PATCH 2/4] Fix #169 --- astprinter.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astprinter.d b/astprinter.d index 33c2165..8f18c98 100644 --- a/astprinter.d +++ b/astprinter.d @@ -780,7 +780,7 @@ class XMLPrinter : ASTVisitor output.writeln(""); output.writeln(""); visit(keyValuePair.value); - output.writeln(""); + output.writeln(""); output.writeln(""); } From 30d5ff8f4945d9e41c24527ee314e2cf19299a60 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sun, 27 Apr 2014 00:00:14 -0700 Subject: [PATCH 3/4] Fix #168 --- astprinter.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/astprinter.d b/astprinter.d index 8f18c98..6a7523f 100644 --- a/astprinter.d +++ b/astprinter.d @@ -479,7 +479,7 @@ class XMLPrinter : ASTVisitor override void visit(const ForStatement forStatement) { output.writeln(""); - if (forStatement.declarationOrStatement !is null) + if (forStatement.initialization !is null) { output.writeln(""); visit(forStatement.initialization); @@ -497,7 +497,8 @@ class XMLPrinter : ASTVisitor visit(forStatement.increment); output.writeln(""); } - visit(forStatement.declarationOrStatement); + if (forStatement.declarationOrStatement !is null) + visit(forStatement.declarationOrStatement); output.writeln(""); } From 55eb188a1573f5b61e5e0b727c6f967d25f06793 Mon Sep 17 00:00:00 2001 From: Matthew Brennan Jones Date: Sun, 27 Apr 2014 13:05:51 -0700 Subject: [PATCH 4/4] Removed the hard coded -m64 in the build.sh script. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 64d1fdb..329e9d9 100755 --- a/build.sh +++ b/build.sh @@ -11,7 +11,7 @@ dmd\ std/d/*.d\ analysis/*.d\ -ofdscanner\ - -m64 -g\ + -g\ -O -release #gdc\