Fixed token position for named tokens

This commit is contained in:
ZZYZX 2020-01-02 01:51:54 +02:00
parent 6374b498ab
commit e015cc6fb1
2 changed files with 2 additions and 1 deletions

View file

@ -242,7 +242,7 @@ namespace CodeImp.DoomBuilder.Rendering.Shaders
string funcOutput = string.Format("#line {0}\n", func.Line) + func.ReturnValue + " " + func.Name + " (" + GetTokenListSource(func.Arguments) + ")";
preOutput += funcOutput + ";\n";
funcOutput += " {\n" + string.Format("#line {0}\n", func.CodeLine) +GetTokenListSource(func.Code) + "}\n";
funcOutput += " {\n" + string.Format("#line {0}\n", func.CodeLine) + GetTokenListSource(func.Code) + "}\n";
output += funcOutput;
}

View file

@ -582,6 +582,7 @@ namespace CodeImp.DoomBuilder.ZDoom
// found the token.
reader.BaseStream.Position = cpos + namedtokentype.Length;
ZScriptToken tok = new ZScriptToken();
tok.Position = cpos;
tok.Type = namedtokentypes[namedtokentype];
tok.Value = namedtokentype;
return tok;