Fix #351 merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
parent
08f73d216b
commit
6eb7b95173
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue