mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
Permit control of single character tokens.
This commit is contained in:
parent
805256ff65
commit
ff857a9c71
2 changed files with 6 additions and 0 deletions
|
@ -45,6 +45,10 @@ typedef struct script_s {
|
|||
void (*error)(struct script_s *script, const char *msg);
|
||||
/// if set, multi line quoted tokens will be treated as errors
|
||||
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;
|
||||
|
||||
/** Return a new script_t object.
|
||||
|
|
|
@ -159,6 +159,8 @@ Script_GetToken (script_t *script, qboolean crossline)
|
|||
} else {
|
||||
const char *single = "{}()':";
|
||||
|
||||
if (script->single)
|
||||
single = script->single;
|
||||
token_p = script->p;
|
||||
if (strchr (single, *script->p)) {
|
||||
script->p++;
|
||||
|
|
Loading…
Reference in a new issue