diff --git a/src/Neon/Decoder.php b/src/Neon/Decoder.php index 5113d900..d1379dc2 100644 --- a/src/Neon/Decoder.php +++ b/src/Neon/Decoder.php @@ -27,7 +27,7 @@ final class Decoder // literal / boolean / integer / float ' - (?: [^#"\',:=[\]{}()\x00-\x20`-] | [:-][^"\',\]})\s] ) + (?: [^#"\',:=[\]{}()\x00-\x20`-] | [:-] [^"\',=[\]{}()\s] ) (?: [^,:=\]})(\x00-\x20]++ | :(?! [\s,\]})] | $ ) | diff --git a/tests/Neon/Decoder.phpt b/tests/Neon/Decoder.phpt index 97dc0b5b..c4357417 100644 --- a/tests/Neon/Decoder.phpt +++ b/tests/Neon/Decoder.phpt @@ -126,9 +126,6 @@ $dataSet = [ ['!hello', '!hello'], - [':[', ':['], - [':{', ':{'], - [':(', ':('], ['::', '::'], [':0', ':0'], [':-1', ':-1'], @@ -136,9 +133,6 @@ $dataSet = [ [':false', ':false'], [':null', ':null'], [':NULL', ':NULL'], - ['-[', '-['], - ['-{', '-{'], - ['-(', '-('], ['-:', '-:'], ['-0', -0], ['-true', '-true'], @@ -211,6 +205,13 @@ $dataSet = [ ['=abc'], ['{a :b}'], ['a :b'], + + ['-['], + ['-{'], + ['-('], + [':['], + [':{'], + [':('], ], // RFC JSON with valid syntax which can not be encoded in UTF-8