diff options
author | David Walter Seikel | 2012-01-12 23:46:08 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-12 23:46:08 +1000 |
commit | fe3dac5464e086cbb39d128f4119391bbffbc9f3 (patch) | |
tree | 6957cd186f33f970182779df68d894953283dae1 | |
parent | A failed attempt to handle multiple files. (diff) | |
download | SledjHamr-fe3dac5464e086cbb39d128f4119391bbffbc9f3.zip SledjHamr-fe3dac5464e086cbb39d128f4119391bbffbc9f3.tar.gz SledjHamr-fe3dac5464e086cbb39d128f4119391bbffbc9f3.tar.bz2 SledjHamr-fe3dac5464e086cbb39d128f4119391bbffbc9f3.tar.xz |
Add a hex integer format, and comment about variations for float.
-rw-r--r-- | LuaSL/src/LuaSL_lexer.l | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l index 93df410..2b60634 100644 --- a/LuaSL/src/LuaSL_lexer.l +++ b/LuaSL/src/LuaSL_lexer.l | |||
@@ -16,9 +16,12 @@ int common(YYSTYPE *lval, char *text, LuaSL_yyparseExtra *extra, boolean checkIg | |||
16 | %option extra-type="LuaSL_yyparseExtra *" | 16 | %option extra-type="LuaSL_yyparseExtra *" |
17 | 17 | ||
18 | HEX [[:xdigit:]] | 18 | HEX [[:xdigit:]] |
19 | INTEGER [[:digit:]]+ | 19 | DECIMAL [[:digit:]] |
20 | EXPONANT [eE][+-]?{INTEGER} | 20 | /* LSL has no octal integer type. */ |
21 | FLOAT {INTEGER}("."{INTEGER})?{EXPONANT}? | 21 | INTEGER ({DECIMAL}+)|(0[xX]{HEX}+) |
22 | EXPONANT [eE][+-]?{DECIMAL} | ||
23 | /* Floats can be "0." but I don't think ".0" is valid. */ | ||
24 | FLOAT {DECIMAL}("."{DECIMAL})?{EXPONANT}?[fF]? | ||
22 | CHAR '(\\.|[^\\'\n])+' | 25 | CHAR '(\\.|[^\\'\n])+' |
23 | STRING \"(\\.|[^\\"\n])*\" | 26 | STRING \"(\\.|[^\\"\n])*\" |
24 | IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])* | 27 | IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])* |