Add a function for retreiving the parsed token.

Saves having to reach into the token's dstring (script->token->str was
getting annoying).
This commit is contained in:
Bill Currie 2010-09-09 20:44:32 +09:00
parent ac88c86dd3
commit 43a9232787
2 changed files with 11 additions and 0 deletions

View file

@ -88,6 +88,11 @@ qboolean Script_GetToken (script_t *script, qboolean crossline);
*/
void Script_UngetToken (script_t *script);
/** Return a pointer to the current token.
\param script The script_t object being parsed
*/
const char *Script_Token (script_t *token);
//@}
#endif//__QF_script_h

View file

@ -178,3 +178,9 @@ Script_UngetToken (script_t *script)
{
script->unget = true;
}
VISIBLE const char *
Script_Token (script_t *script)
{
return script->token->str;
}