diff options
-rw-r--r-- | scan.c | 4 | ||||
-rw-r--r-- | tests/float-const-leading-dot.c | 1 | ||||
-rw-r--r-- | tests/float-const-leading-dot.qbe | 1 |
3 files changed, 6 insertions, 0 deletions
@@ -336,6 +336,10 @@ again: return TRBRACE; case '.': nextchar(s); + if (isdigit(s->chr)) { + bufadd(&s->buf, '.'); + return number(s); + } if (s->chr != '.') return TPERIOD; loc = s->loc; diff --git a/tests/float-const-leading-dot.c b/tests/float-const-leading-dot.c new file mode 100644 index 0000000..bfed54a --- /dev/null +++ b/tests/float-const-leading-dot.c @@ -0,0 +1 @@ +float x = .5; diff --git a/tests/float-const-leading-dot.qbe b/tests/float-const-leading-dot.qbe new file mode 100644 index 0000000..12ae325 --- /dev/null +++ b/tests/float-const-leading-dot.qbe @@ -0,0 +1 @@ +export data $x = align 4 { s s_0x1p-1, } |