From 1dea9e3946c285c2fbd08bb87a839784a6709ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Szeremeta?= Date: Sun, 18 Feb 2024 22:12:39 +0100 Subject: [PATCH] Disallow leading zeroes in UNSIGNED_INT (fixes #87) --- other-notations/YARSpg.ebnf | 2 +- yarspg/YARSpg.g4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/other-notations/YARSpg.ebnf b/other-notations/YARSpg.ebnf index e07cef5..31fd1d7 100644 --- a/other-notations/YARSpg.ebnf +++ b/other-notations/YARSpg.ebnf @@ -170,7 +170,7 @@ OPTIONAL ::= ( 'O' | 'o' ) ( 'P' | 'p' ) ( 'T' | 't' ) ( 'I' | 'i' ) ( 'O' | 'o' COMMENT ::= '#' [^#xd#xa#xc]* STR ::= '"' ( [^#x22#x5C#xd#xa] | '\' [tbnrf#x22#x27#x5C])* '"' /* #x22=" #x5C=\ #xD=carriage return #xA=new line #x27='; */ UNSIGNED_INT - ::= [0-9]+ + ::= '0' | [1-9] [0-9]* ALNUMPLUS ::= [a-zA-Z_] [a-zA-Z0-9_]* WS ::= [ #x9#xa]+ diff --git a/yarspg/YARSpg.g4 b/yarspg/YARSpg.g4 index 0567d01..9e3fe5f 100644 --- a/yarspg/YARSpg.g4 +++ b/yarspg/YARSpg.g4 @@ -289,7 +289,7 @@ STR ; UNSIGNED_INT - : [0-9]+ + : '0' | [1-9] [0-9]* ; ALNUMPLUS