mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-08 05:51:26 +00:00
c54f2f66fc
while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
137 lines
2.9 KiB
C++
137 lines
2.9 KiB
C++
#define YYCTYPE char
|
|
#define YYCURSOR cursor
|
|
#define YYLIMIT limit
|
|
#define YYMARKER marker
|
|
|
|
// This buffer must be as large as the largest YYFILL call
|
|
YYCTYPE eofbuf[2];
|
|
#define YYFILL(n) { if(n == 2) { eofbuf[0] = *cursor; } eofbuf[n-1] = '\n'; cursor = eofbuf; limit = eofbuf + n - 1; sc_End = true; }
|
|
|
|
//#define YYDEBUG(s,c) { Printf ("%d: %02x\n", s, c); }
|
|
#define YYDEBUG(s,c)
|
|
|
|
char *cursor = ScriptPtr;
|
|
char *limit = ScriptEndPtr;
|
|
|
|
std:
|
|
tok = YYCURSOR;
|
|
/*!re2c
|
|
any = [\000-\377];
|
|
WSP = ([\000- ]\[\n]);
|
|
NWS = (any\[\000- ]);
|
|
D = [0-9];
|
|
|
|
TOK1 = [{}|=];
|
|
TOKC = [{}|=/`~!@#$%^&*()\[\]\\?\-=+;:<>,.];
|
|
|
|
STOP1 = (TOK1|["/;]);
|
|
STOPC = (TOKC|["]);
|
|
|
|
TOK2 = (NWS\STOP1);
|
|
TOKC2 = (NWS\STOPC);
|
|
*/
|
|
if (!CMode)
|
|
{
|
|
/*!re2c
|
|
"/*" { goto comment; } /* C comment */
|
|
("//"|";") (any\"\n")* "\n" { goto newline; } /* C++/Hexen comment */
|
|
|
|
WSP+ { goto std; } /* whitespace */
|
|
"\n" { goto newline; }
|
|
"\"" { goto string; }
|
|
|
|
TOK1 { goto normal_token; }
|
|
|
|
/* Regular tokens may contain /, but they must not contain comment starts */
|
|
TOK2* ([/] (TOK2\[*])+ [*]*)* [/]? { goto normal_token; }
|
|
|
|
any { goto normal_token; } /* unknown character */
|
|
*/
|
|
}
|
|
else
|
|
{
|
|
/*!re2c
|
|
"/*" { goto comment; } /* C comment */
|
|
"//" (any\"\n")* "\n" { goto newline; } /* C++ comment */
|
|
|
|
WSP+ { goto std; } /* whitespace */
|
|
"\n" { goto newline; }
|
|
"\"" { goto string; }
|
|
|
|
[-]? D+ ([.]D*)? { goto normal_token; } /* number */
|
|
"&&" { goto normal_token; }
|
|
"==" { goto normal_token; }
|
|
"||" { goto normal_token; }
|
|
"<<" { goto normal_token; }
|
|
">>" { goto normal_token; }
|
|
TOKC { goto normal_token; }
|
|
TOKC2+ { goto normal_token; }
|
|
|
|
any { goto normal_token; } /* unknown character */
|
|
*/
|
|
}
|
|
|
|
comment:
|
|
/*!re2c
|
|
"*/" { goto std; }
|
|
"\n"
|
|
{
|
|
if (YYCURSOR >= YYLIMIT)
|
|
{
|
|
ScriptPtr = ScriptEndPtr;
|
|
return false;
|
|
}
|
|
sc_Line++;
|
|
sc_Crossed = true;
|
|
goto comment;
|
|
}
|
|
any { goto comment; }
|
|
*/
|
|
|
|
newline:
|
|
if (YYCURSOR >= YYLIMIT)
|
|
{
|
|
ScriptPtr = ScriptEndPtr;
|
|
return false;
|
|
}
|
|
sc_Line++;
|
|
sc_Crossed = true;
|
|
goto std;
|
|
|
|
normal_token:
|
|
ScriptPtr = (YYCURSOR >= YYLIMIT) ? ScriptEndPtr : cursor;
|
|
sc_StringLen = MIN (ScriptPtr - tok, MAX_STRING_SIZE-1);
|
|
memcpy (sc_String, tok, sc_StringLen);
|
|
sc_String[sc_StringLen] = '\0';
|
|
return true;
|
|
|
|
string:
|
|
if (YYLIMIT != ScriptEndPtr)
|
|
{
|
|
ScriptPtr = ScriptEndPtr;
|
|
return false;
|
|
}
|
|
ScriptPtr = cursor;
|
|
for (sc_StringLen = 0; cursor < YYLIMIT; ++cursor)
|
|
{
|
|
if (Escape && *cursor == '\\' && *(cursor + 1) == '"')
|
|
{
|
|
cursor++;
|
|
}
|
|
else if (*cursor == '"')
|
|
{
|
|
break;
|
|
}
|
|
if (*cursor == '\n')
|
|
{
|
|
sc_Line++;
|
|
sc_Crossed = true;
|
|
}
|
|
if (sc_StringLen < MAX_STRING_SIZE-1)
|
|
{
|
|
sc_String[sc_StringLen++] = *cursor;
|
|
}
|
|
}
|
|
ScriptPtr = cursor + 1;
|
|
sc_String[sc_StringLen] = '\0';
|
|
return true;
|