ZScript: fixed a problem where whitespace between a state label and the colon resulted in a parsing error. Fixes #631

This commit is contained in:
biwa 2021-10-11 21:34:26 +02:00
parent d2d400164d
commit 8f70ab66f2
2 changed files with 6 additions and 3 deletions

View file

@ -215,8 +215,9 @@ namespace CodeImp.DoomBuilder.ZDoom
if (statelabel == null)
return false;
// otherwise expect a colon
token = tokenizer.ExpectToken(ZScriptTokenType.Colon);
// otherwise expect a colon
tokenizer.SkipWhitespace(); // Skip whitepace because there might be whitepsace between the state label and the colon. See https://github.com/jewalky/UltimateDoomBuilder/issues/631
token = tokenizer.ExpectToken(ZScriptTokenType.Colon);
if (token == null || !token.IsValid)
{
parser.ReportError("Expected :, got " + ((Object)token ?? "<null>").ToString());

View file

@ -107,7 +107,9 @@ namespace CodeImp.DoomBuilder.ZDoom
continue;
}
}
tokenizer.SkipWhitespace(); // Skip whitepace because there might be whitepsace between the state label and the colon. See https://github.com/jewalky/UltimateDoomBuilder/issues/631
}
// make sure it's not a label of the next state. if it is, break out.
long cpos2 = stream.Position; // local rewind point