Skip to content

Commit

Permalink
[ext/JSON] sync from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Aug 24, 2012
1 parent 506a8f7 commit 8459527
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ext/JSON__Tiny/lib/JSON/Tiny.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ')
~ ' ]';
Expand Down
8 changes: 4 additions & 4 deletions ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm
Original file line number Diff line number Diff line change
@@ -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> {
Expand Down

0 comments on commit 8459527

Please sign in to comment.