Skip to content
Browse files

Split rule array into array and arraylist -- should be equivalent, bu…

…t in practice makes niecza much happier.
  • Loading branch information...
1 parent 9c22fd0 commit 71e08dce2e9a6a6dcde8344873b67503089bb636 @colomon colomon committed Jan 21, 2012
Showing with 6 additions and 1 deletion.
  1. +4 −0 lib/JSON/Tiny/Actions.pm
  2. +2 −1 lib/JSON/Tiny/Grammar.pm
View
4 lib/JSON/Tiny/Actions.pm
@@ -16,6 +16,10 @@ method pair($/) {
}
method array($/) {
+ make $<arraylist>.ast;
+}
+
+method arraylist($/) {
make [$<value>>>.ast];
}
View
3 lib/JSON/Tiny/Grammar.pm
@@ -5,7 +5,8 @@ rule TOP { ^[ <object> | <array> ]$ }
rule object { '{' ~ '}' <pairlist> }
rule pairlist { [ <pair>+ % [ \, ] ]? }
rule pair { <string> ':' <value> }
-rule array { '[' ~ ']' [ <value>+ % [ \, ] ]? }
+rule array { '[' ~ ']' <arraylist> }
+rule arraylist { [ <value>+ % [ \, ] ]? }
proto token value {*};
token value:sym<number> {

0 comments on commit 71e08dc

Please sign in to comment.
Something went wrong with that request. Please try again.