From 1dccd8a27844b77cef8d91e3041141065cf5103c Mon Sep 17 00:00:00 2001 From: Jeff Ober Date: Fri, 10 Jan 2020 13:55:42 -0500 Subject: [PATCH] Integers apparently may not have double, leading, or trailing underscores --- lib/TOML/Tiny/Grammar.pm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/TOML/Tiny/Grammar.pm b/lib/TOML/Tiny/Grammar.pm index 784b53a..0471185 100644 --- a/lib/TOML/Tiny/Grammar.pm +++ b/lib/TOML/Tiny/Grammar.pm @@ -59,22 +59,16 @@ our $TOML = qr{ (? (?&Key) (?&WS) = (?&WS) (?&Value) (?&WS) (?&NL)) (? - (?&KeyValuePair) (?&WS) [,] (?&WS) (?&KeyValuePairList)? + (?&KeyValuePair) (?&WS) (?: [,] (?&WS) (?&KeyValuePairList) )? | (?&KeyValuePair) ) (? - (?s) - { - (?&WS) (?&NLSeq)? (?&WS) - + (?&WS) (?&KeyValuePairList) - - (?&WS) (?&NLSeq)? (?&WS) + (?&WS) } - - (?-s) ) (? @@ -136,10 +130,16 @@ our $TOML = qr{ #----------------------------------------------------------------------------- # Integer #----------------------------------------------------------------------------- - (? [-+]? [_0-9]+) - (? 0x[_0-9a-fA-F]+) - (? 0o[_0-7]+) - (? 0b[_01]+) + (? [0-9]) + (? (?&DecChar) | [a-f A-F]) + (? [0-7]) + (? [01]) + + (? [-+]? (?&DecChar) (?: (?&DecChar) | (?: _ (?&DecChar) ))*) + (? 0x (?&HexChar) (?: (?&HexChar) | (?: [_] (?&HexChar) ))*) + (? 0o (?&OctChar) (?: (?&OctChar) | (?: [_] (?&OctChar) ))*) + (? 0b (?&BinChar) (?: (?&BinChar) | (?: [_] (?&BinChar) ))*) + (? (?&Hex) | (?&Oct) | (?&Bin) | (?&Dec)) #----------------------------------------------------------------------------- -- 2.30.2