This commit is contained in:
Hackerpilot 2018-05-06 16:34:51 -07:00
parent 08f73d216b
commit 03f38dbad3
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
commentText = commentText[2 .. $ - 2]; {
if (commentText.length > 3)
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];
} }