mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[cexpr] Use ` to allow identifiers to start with a number
The generated short names for a lot of Vulkan enums start with a number (eg VK_IMAGE_TYPE_2D -> 2d). Having to prefix the short name with ` is a tiny cost for the convenience.
This commit is contained in:
parent
a6703c95cf
commit
614c744693
1 changed files with 7 additions and 1 deletions
|
@ -108,7 +108,8 @@ m [\-+]
|
|||
D [0-9]
|
||||
B [01]
|
||||
X [0-9a-fA-F]
|
||||
ID [a-zA-Z_][a-zA-Z_0-9]*
|
||||
id [a-zA-Z_0-9]*
|
||||
ID [a-zA-Z_]{id}
|
||||
FLOAT ({D}+|{D}*\.{D}+|{D}+\.{D}*)([eE]{m}?{D}+)?
|
||||
FLOATf {FLOAT}[fF]
|
||||
FLOATd {FLOAT}[dD]
|
||||
|
@ -153,6 +154,11 @@ STRING \"(\\.|[^"\\])*\"
|
|||
return NAME;
|
||||
}
|
||||
|
||||
`{id} {
|
||||
yylval->symbol = parse_name (yytext + 1, context);
|
||||
return NAME;
|
||||
}
|
||||
|
||||
\${ID} {
|
||||
yylval->value = parse_variable (yytext + 1, context);
|
||||
return VALUE;
|
||||
|
|
Loading…
Reference in a new issue