Fixed dumb parsing error

This commit is contained in:
Hackerpilot 2014-01-13 21:50:40 +00:00
parent efbf9952b3
commit 952b5e364a
2 changed files with 18 additions and 2 deletions

View File

@ -1127,6 +1127,12 @@ public struct DLexer(R)
auto app = appender!string();
app.put("q{");
int depth = 1;
LexerConfig c = config;
scope(exit) config = c;
config.whitespaceBehavior = WhitespaceBehavior.include;
config.stringBehavior = StringBehavior.source;
config.commentBehavior = CommentBehavior.include;
_front = advance();
while (depth > 0 && !empty)
@ -1414,5 +1420,5 @@ public struct DLexer(R)
}
const LexerConfig config;
LexerConfig config;
}

View File

@ -4084,6 +4084,11 @@ q{(int a, ...)
{
mixin(traceEnterAndExit!(__FUNCTION__));
auto node = new PrimaryExpression;
if (!moreTokens())
{
error("Expected primary statement instead of EOF");
return null;
}
switch (current.type)
{
case tok!".":
@ -4407,6 +4412,11 @@ q{(int a, ...)
{
mixin(traceEnterAndExit!(__FUNCTION__));
auto node = new Statement;
if (!moreTokens())
{
error("Expected statement instead of EOF");
return null;
}
switch (current.type)
{
case tok!"case":
@ -5801,7 +5811,7 @@ q{doStuff(5)}c;
Unittest parseUnittest()
{
mixin(traceEnterAndExit!(__FUNCTION__));
mixin (simpleParse!(Unittest, tok!"unittest", "blockStatement|parseBlockStatement", true));
mixin (simpleParse!(Unittest, tok!"unittest", "blockStatement|parseBlockStatement"));
}
/**