Export FScanner parser to ZScript as ScriptScanner
This commit is contained in:
parent
fd9b762106
commit
a368588db6
4 changed files with 428 additions and 4 deletions
|
|
@ -260,6 +260,7 @@ void FScanner::PrepareScript ()
|
|||
StateOptions = false;
|
||||
StringBuffer[0] = '\0';
|
||||
BigStringBuffer = "";
|
||||
ParseError = false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -1089,13 +1090,14 @@ void FScanner::ScriptError (const char *message, ...)
|
|||
va_end (arglist);
|
||||
}
|
||||
|
||||
ParseError = true;
|
||||
if (NoFatalErrors)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Script error, \"%s\"" TEXTCOLOR_RED " line %d:\n" TEXTCOLOR_RED "%s\n", ScriptName.GetChars(),
|
||||
Printf(TEXTCOLOR_RED "%sScript error, \"%s\"" TEXTCOLOR_RED " line %d:\n" TEXTCOLOR_RED "%s\n", PrependMessage.GetChars(), ScriptName.GetChars(),
|
||||
AlreadyGot ? AlreadyGotLine : Line, composed.GetChars());
|
||||
return;
|
||||
}
|
||||
I_Error ("Script error, \"%s\" line %d:\n%s\n", ScriptName.GetChars(),
|
||||
I_Error ("%sScript error, \"%s\" line %d:\n%s\n", PrependMessage.GetChars(), ScriptName.GetChars(),
|
||||
AlreadyGot? AlreadyGotLine : Line, composed.GetChars());
|
||||
}
|
||||
|
||||
|
|
@ -1121,7 +1123,8 @@ void FScanner::ScriptMessage (const char *message, ...)
|
|||
va_end (arglist);
|
||||
}
|
||||
|
||||
Printf (TEXTCOLOR_RED "Script error, \"%s\"" TEXTCOLOR_RED " line %d:\n" TEXTCOLOR_RED "%s\n", ScriptName.GetChars(),
|
||||
ParseError = true;
|
||||
Printf (TEXTCOLOR_RED "%sScript error, \"%s\"" TEXTCOLOR_RED " line %d:\n" TEXTCOLOR_RED "%s\n", PrependMessage.GetChars(), ScriptName.GetChars(),
|
||||
AlreadyGot? AlreadyGotLine : Line, composed.GetChars());
|
||||
}
|
||||
|
||||
|
|
@ -1383,4 +1386,3 @@ int ParseHex(const char* hex, FScriptPosition* sc)
|
|||
return num;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue