Fix #351
merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
Brian Schott 2018-05-06 22:04:20 -07:00 committed by The Dlang Bot
parent 08f73d216b
commit 6eb7b95173
1 changed files with 7 additions and 5 deletions

View File

@ -375,7 +375,12 @@ private:
if (commentText[0 .. 2] == "//") if (commentText[0 .. 2] == "//")
commentText = commentText[2 .. $]; commentText = commentText[2 .. $];
else else
{
if (commentText.length > 3)
commentText = commentText[2 .. $ - 2]; commentText = commentText[2 .. $ - 2];
else
commentText = commentText[2 .. $];
}
return commentText.strip(); return commentText.strip();
} }
@ -1693,10 +1698,7 @@ const pure @safe @nogc:
const(Token) peekBack(uint distance = 1) nothrow const(Token) peekBack(uint distance = 1) nothrow
{ {
if (index < distance) assert(index >= distance, "Trying to peek before the first token");
{
assert(0, "Trying to peek before the first token");
}
return tokens[index - distance]; return tokens[index - distance];
} }