From d89f65a592654f4a8d359ce4a9e18a0067bc7efd Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Fri, 23 Feb 2024 17:00:36 -0600 Subject: [PATCH] Add octal-prefix grammar to support "0o" and "0O" --- spec/09-lexical-structure.md | 10 ++++++++-- spec/19-grammar.md | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/spec/09-lexical-structure.md b/spec/09-lexical-structure.md index 537c993..f6c073f 100644 --- a/spec/09-lexical-structure.md +++ b/spec/09-lexical-structure.md @@ -440,9 +440,12 @@ decimal-literal:: decimal-literal digit octal-literal:: - '0' + octal-prefix octal-digit octal-literal octal-digit +octal-prefix:: one of + '0' '0o' '0O' + hexadecimal-literal:: hexadecimal-prefix hexadecimal-digit hexadecimal-literal hexadecimal-digit @@ -487,9 +490,12 @@ binary-digit:: one of decimal-literal digit octal-literal:: - 0 + octal-prefix octal-digit octal-literal octal-digit +octal-prefix:: one of + 0 0o 0O + hexadecimal-literal:: hexadecimal-prefix hexadecimal-digit hexadecimal-literal hexadecimal-digit diff --git a/spec/19-grammar.md b/spec/19-grammar.md index e52237c..be75840 100644 --- a/spec/19-grammar.md +++ b/spec/19-grammar.md @@ -110,9 +110,12 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md# decimal-literal digit octal-literal:: - 0 + octal-prefix octal-digit octal-literal octal-digit +octal-prefix:: one of + 0 0o 0O + hexadecimal-literal:: hexadecimal-prefix hexadecimal-digit hexadecimal-literal hexadecimal-digit