Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mutability bug #18

Merged
merged 1 commit into from
Aug 21, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ml-proto/src/parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type context =
{funcs : space; globals : space; locals : space; labels : int VarMap.t}

let empty () = {map = VarMap.empty; count = 0}
let c0 =
let c0 () =
{funcs = empty (); globals = empty ();
locals = empty (); labels = VarMap.empty}

Expand Down Expand Up @@ -286,7 +286,7 @@ module_fields :
{m with data = $3 ^ m.data} }
;
modul :
| LPAR MODULE module_fields RPAR { $3 c0 @@ at() }
| LPAR MODULE module_fields RPAR { $3 (c0 ()) @@ at() }
;


Expand All @@ -295,9 +295,9 @@ modul :
cmd :
| modul { Define $1 @@ at() }
| LPAR INVOKE TEXT expr_list RPAR
{ Invoke ($3, $4 c0) @@ at() }
{ Invoke ($3, $4 (c0 ())) @@ at() }
| LPAR ASSERTEQ LPAR INVOKE TEXT expr_list RPAR expr_list RPAR
{ AssertEqInvoke ($5, $6 c0, $8 c0) @@ at() }
{ AssertEqInvoke ($5, $6 (c0 ()), $8 (c0 ())) @@ at() }
;
cmd_list :
| /* empty */ { [] }
Expand Down