Fix bug in actor compiler that would cause multi-line comments to be marked with the wrong line numbers.

This commit is contained in:
A.J. Beamon 2018-06-13 10:15:20 -07:00
parent 497026003e
commit 6f941a89b4
1 changed files with 1 additions and 1 deletions

View File

@ -874,13 +874,13 @@ namespace actorcompiler
case "\r\n": LineCount++; break;
case "\n": LineCount++; break;
}
if (tokens[i].Value.StartsWith("/*")) LineCount += tokens[i].Value.Count(c=>c=='\n');
if (BraceDepth < 0) throw new Error(LineCount, "Mismatched braces");
if (ParenDepth < 0) throw new Error(LineCount, "Mismatched parenthesis");
tokens[i].Position = i;
tokens[i].SourceLine = LineCount;
tokens[i].BraceDepth = BraceDepth;
tokens[i].ParenDepth = ParenDepth;
if (tokens[i].Value.StartsWith("/*")) LineCount += tokens[i].Value.Count(c=>c=='\n');
switch (tokens[i].Value)
{
case "{": BraceDepth++; if (BraceDepth==1) lastBrace = tokens[i]; break;