diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-10-05 20:44:26 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-10-05 20:44:26 -0700 |
commit | d1ea8403e913d014b43dfed73b4b844ddb7684ff (patch) | |
tree | cdf5225daf47eca1142cbde626aeb18f1677e9c4 /ffi.c | |
parent | 86b75db7f8142aaa16cd455c9c876cb930e005e9 (diff) | |
download | txr-d1ea8403e913d014b43dfed73b4b844ddb7684ff.tar.gz txr-d1ea8403e913d014b43dfed73b4b844ddb7684ff.tar.bz2 txr-d1ea8403e913d014b43dfed73b4b844ddb7684ff.zip |
Syntax: allow separator commas in numeric tokens.
* parser.l (remove_char): New static function.
(DIGSEP, XDIGSEP, NUMSEP, FLOSEP, XNUMSEP, ONUMSEP,
BNUMSEP, ONUM, BNUM): New named lex patterns.
(FLODOT): Use DIGSEP instead of DIG.
(ONUM): Use ODIG instead of [0-7].
(BNUM): Use BDIG instead of [0-1].
(grammar): New rule for producing NUMBER from decimal
token with commas based on BNUMSEP instead of BNUM.
This is a copy and paste so that the BNUM rule doesn't
deal with the comma removal, not to slow it down.
For the octal, binary and hex, we just switch to
BNUMSEP, ONUMSEP and XNUMSEP, so they all go through
one case.
Floating point numbers are also handled with a copy
pasted case using FLOSEP.
* tests/012/syntax.tl: New test cases.
* txr.1: Documented.
* genvim.txr (alpha-noe, digsep, hexsep, octsep, binsep): New
variables.
(txr_pnum, txr_xnum, txr_onum, txr_bnum, txr_num): Integrate
separating commas. Some bugs fixed in txr_num, some simplifications,
better txr_badnum pattern.
* lex.yy.c.shipped: Updated.
Diffstat (limited to 'ffi.c')
0 files changed, 0 insertions, 0 deletions