Fix bug in HEREDOC string literal lexing

This commit is contained in:
Hackerpilot 2014-01-29 15:39:57 -08:00
parent 8bf1f5b36f
commit bf7f098799
2 changed files with 8 additions and 6 deletions

View File

@ -1120,17 +1120,21 @@ public struct DLexer
if (isNewline())
{
popFrontWhitespaceAware();
if (range.peek(ident.text.length) == ident.text)
if (!range.canPeek(ident.text.length))
{
foreach (i ; 0 .. ident.text.length)
range.popFront();
error(ident.text ~ " expected");
break;
}
if (range.peek(ident.text.length - 1) == ident.text)
{
range.popFrontN(ident.text.length);
break;
}
}
else
range.popFront();
}
if (range.front == '"')
if (!range.empty() && range.front == '"')
range.popFront();
else
error(`" expected`);

View File

@ -1780,8 +1780,6 @@ class ClassFour(A, B) if (someTest()) : Super {}}c;
auto dos = parseDeclarationOrStatement();
if (dos !is null)
node.declarationsAndStatements ~= dos;
/*else
return null;*/
}
return node;
}