0
0
Fork 0
mirror of https://git.code.sf.net/p/quake/quakeforge synced 2025-02-26 13:41:21 +00:00

Permit control of single character tokens.

This commit is contained in:
Bill Currie 2011-08-11 14:22:27 +09:00
parent 805256ff65
commit ff857a9c71
2 changed files with 6 additions and 0 deletions
include/QF
libs/util

View file

@ -45,6 +45,10 @@ typedef struct script_s {
void (*error)(struct script_s *script, const char *msg); void (*error)(struct script_s *script, const char *msg);
/// if set, multi line quoted tokens will be treated as errors /// if set, multi line quoted tokens will be treated as errors
int no_quote_lines; int no_quote_lines;
/// if set, characters in this string will always be lexed as single
/// character tokens. If not set, defaults to "{}()':". Set to ""
/// (empty string) to disable. Not set by default.
const char *single;
} script_t; } script_t;
/** Return a new script_t object. /** Return a new script_t object.

View file

@ -159,6 +159,8 @@ Script_GetToken (script_t *script, qboolean crossline)
} else { } else {
const char *single = "{}()':"; const char *single = "{}()':";
if (script->single)
single = script->single;
token_p = script->p; token_p = script->p;
if (strchr (single, *script->p)) { if (strchr (single, *script->p)) {
script->p++; script->p++;