summaryrefslogtreecommitdiff
path: root/g.peg
diff options
context:
space:
mode:
Diffstat (limited to 'g.peg')
-rw-r--r--g.peg6
1 files changed, 6 insertions, 0 deletions
diff --git a/g.peg b/g.peg
index dccf361..056ca7a 100644
--- a/g.peg
+++ b/g.peg
@@ -29,12 +29,18 @@ expr <-
/ n:number { $$ = n; }
/ i:ident { $$ = i; }
/ t:string { $$ = t; }
+ / a:array { $$ = a; }
list <- { $$ = astnode_new_list(); }
'('
( e:expr { astnode_append(&$$, e); }
)*
')' _
+array <- { $$ = astnode_new_arr(); }
+ '['
+ ( e:expr { astnode_append(&$$, e); }
+ )*
+ ']' _
number <- < [0-9]+ > (! ident_char) _ { $$ = astnode_new_num(atoi($1)); }
ident <- < ident_char+ > _ { $$ = astnode_new_ident($1); }