diff options
Diffstat (limited to 'g.peg')
-rw-r--r-- | g.peg | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); } |