From f3e5ff60270792ed7fb27ad3db787ff02a1de52c Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Tue, 30 May 2023 14:13:46 -0700 Subject: [PATCH] Rearrange the number production to put decimal at the end While the grammar makes no statements about match order, parsers pretty universally test for decimal last, after the other number productions, because `0b010` (/etc) can look like a `0` followed by garbage. Matching this order can reduce confusion. Closes #330. --- SPEC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPEC.md b/SPEC.md index f2aa04c..aa75d85 100644 --- a/SPEC.md +++ b/SPEC.md @@ -484,7 +484,7 @@ raw-string := 'r' raw-string-hash raw-string-hash := '#' raw-string-hash '#' | raw-string-quotes raw-string-quotes := '"' .* '"' -number := decimal | hex | octal | binary +number := hex | octal | binary | decimal decimal := sign? integer ('.' integer)? exponent? exponent := ('e' | 'E') sign? integer