From 563759a5b7cc8b6c72b3249d65246d077e961784 Mon Sep 17 00:00:00 2001 From: jimtahu Date: Thu, 16 May 2013 12:39:05 -0400 Subject: [PATCH] Fixed the list storage error --- LangS.ypp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/LangS.ypp b/LangS.ypp index dc1034d..333aef3 100644 --- a/LangS.ypp +++ b/LangS.ypp @@ -34,7 +34,6 @@ 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; } @@ -42,7 +41,7 @@ Value: STRING { $$ = $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); }