diff --git a/caml/CMparser.mly b/caml/CMparser.mly index 99e2a6c3fd3611fbdfbb3c475b52d42b02e393bb..d461a1575e974289ffb6f5af401fb62a04f2bcdd 100644 --- a/caml/CMparser.mly +++ b/caml/CMparser.mly @@ -208,9 +208,9 @@ var_declaration: stmt: expr SEMICOLON { Sexpr $1 } | IF LPAREN expr RPAREN stmts ELSE stmts { Cmconstr.ifthenelse $3 $5 $7 } - | IF LPAREN expr RPAREN stmts { Cmconstr.ifthenelse $3 $5 Snil } + | IF LPAREN expr RPAREN stmts { Cmconstr.ifthenelse $3 $5 Sskip } | LOOP stmts { Sloop($2) } - | LBRACELBRACE stmts RBRACERBRACE { Sblock($2) } + | LBRACELBRACE stmt_list RBRACERBRACE { Sblock($2) } | EXIT SEMICOLON { Sexit O } | EXIT INTLIT SEMICOLON { Sexit (nat_of_camlint(Int32.pred $2)) } | RETURN SEMICOLON { Sreturn None } @@ -219,12 +219,12 @@ stmt: stmts: LBRACE stmt_list RBRACE { $2 } - | stmt { Scons($1, Snil) } + | stmt { $1 } ; stmt_list: - /* empty */ { Snil } - | stmt stmt_list { Scons($1, $2) } + /* empty */ { Sskip } + | stmt stmt_list { Sseq($1, $2) } ; /* Expressions */ diff --git a/caml/RTLgenaux.ml b/caml/RTLgenaux.ml index 3e6ca3d35226c9b384b63999e1b1f34e6f5e4832..336346afdb529a6873a73b211e52fb633ac63527 100644 --- a/caml/RTLgenaux.ml +++ b/caml/RTLgenaux.ml @@ -1,3 +1,3 @@ open Cminor -let more_likely (c: condexpr) (ifso: stmtlist) (ifnot: stmtlist) = false +let more_likely (c: condexpr) (ifso: stmt) (ifnot: stmt) = false