Skip to content

Commit

Permalink
Fixed the list storage error
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtahu committed May 16, 2013
1 parent c347acb commit 563759a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions LangS.ypp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ Prog: Stm ';' Prog { theProg->add((Statement *)$1); }

Stm: Exit { $$ = new ExitStatement();}
| Ident '=' Value { $$ = new AssingmentStatement((Identifier*)$1,(Value*)$3); }
| Value { }
| Print Value { $$ = new PrintStatement((Value*)$2); }

Value: STRING { $$ = $1; }
| Ident { $$ = $1; }
| Items { $$ = $1; }
| Value BinOP Value { $$ = new BinOpValue(((Identifier*)$2)->getName(),(Value*)$1,(Value*)$3); }

Items: '[' List ']' { $$ = $1; }
Items: '[' List ']' { $$ = $2; }

List: List ',' Value { ((ListValue *)$1)->add((Value*)$3); $$ = $1; }
| Value { $$ = new ListValue((Value*)$1); }
Expand Down

0 comments on commit 563759a

Please sign in to comment.