summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-13 15:34:31 -0500
committerJune McEnroe <june@causal.agency>2021-01-13 15:34:31 -0500
commit893ea3fb01983a545802afc2e77120687a531cde (patch)
tree8a8417581a7625b0d9af2eb4b0765c19314cf9f1 /bin
parentSupport long double in c.sh (diff)
downloadsrc-893ea3fb01983a545802afc2e77120687a531cde.tar.gz
src-893ea3fb01983a545802afc2e77120687a531cde.zip
Fix C lexer to require a digit in a float literal
Otherwise ".l" is matched as Number.
Diffstat (limited to '')
-rw-r--r--bin/c11.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/c11.l b/bin/c11.l
index d7a80ae2..c889173e 100644
--- a/bin/c11.l
+++ b/bin/c11.l
@@ -44,7 +44,7 @@ sizeof|(_A|alignof) {
 }
 
 ([1-9][0-9]*|"0"[0-7]*|"0x"[[:xdigit:]]+)([ulUL]{0,3}) |
-[0-9]*("."[0-9]*)?([eE][+-]?[0-9]+)?[flFL]? |
+([0-9]+("."[0-9]*)?|[0-9]*"."[0-9]+)([eE][+-]?[0-9]+)?[flFL]? |
 "0x"[[:xdigit:]]*("."[[:xdigit:]]*)?([pP][+-]?[0-9]+)[flFL]? {
 	return Number;
 }