Permalink
Browse files

[ext/JSON] sync from upstream

  • Loading branch information...
moritz committed Aug 24, 2012
1 parent 506a8f7 commit 84595272878aef28f1f6a6d174bd234492c7be7f
Showing with 5 additions and 5 deletions.
  1. +1 −1 ext/JSON__Tiny/lib/JSON/Tiny.pm
  2. +4 −4 ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm
@@ -29,7 +29,7 @@ multi to-json(Str:D $d) {
.subst(/<-[\c32..\c126]>/, { ord(~$_).fmt('\u%04x') }, :g)
~ '"'
}
-multi to-json(Array:D $d) {
+multi to-json(Positional:D $d) {
return '[ '
~ $d.map(&to-json).join(', ')
~ ' ]';
@@ -1,12 +1,12 @@
use v6;
grammar JSON::Tiny::Grammar;
-rule TOP { ^[ <object> | <array> ]$ }
+rule TOP { ^ [ <object> | <array> ] $ }
rule object { '{' ~ '}' <pairlist> }
-rule pairlist { <pair>* % \, }
-rule pair { <string> ':' <value> }
+rule pairlist { <?> <pair> * % \, }
+rule pair { <?> <string> ':' <value> }
rule array { '[' ~ ']' <arraylist> }
-rule arraylist { <value>* % [ \, ] }
+rule arraylist { <?> <value>* % [ \, ] }
proto token value {*};
token value:sym<number> {

0 comments on commit 8459527

Please sign in to comment.