diff options
| author | Jon French | 2019-04-15 16:18:18 +0100 |
|---|---|---|
| committer | Jon French | 2019-04-15 16:18:18 +0100 |
| commit | a9f0b829507e9882efdb59cce4d83ea7e87f5f71 (patch) | |
| tree | 11cde6c1918bc15f4dda9a8e40afd4a1fe912a0a /src/interpreter.ml | |
| parent | 0f6fd188ca232cb539592801fcbb873d59611d81 (diff) | |
| parent | 57443173923e87f33713c99dbab9eba7e3db0660 (diff) | |
Merge branch 'sail2' into rmem_interpreter
Diffstat (limited to 'src/interpreter.ml')
| -rw-r--r-- | src/interpreter.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/interpreter.ml b/src/interpreter.ml index 1ebfdeff..263430f1 100644 --- a/src/interpreter.ml +++ b/src/interpreter.ml @@ -545,6 +545,11 @@ let rec step (E_aux (e_aux, annot) as orig_exp) = let record = coerce_record (value_of_exp exp) in return (exp_of_value (StringMap.find (string_of_id id) record)) + | E_var (lexp, exp, E_aux (E_block body, _)) -> + wrap (E_block (E_aux (E_assign (lexp, exp), annot) :: body)) + | E_var (lexp, exp, body) -> + wrap (E_block [E_aux (E_assign (lexp, exp), annot); body]) + | E_assign (lexp, exp) when not (is_value exp) -> step exp >>= fun exp' -> wrap (E_assign (lexp, exp')) | E_assign (LEXP_aux (LEXP_memory (id, args), _), exp) -> wrap (E_app (id, args @ [exp])) | E_assign (LEXP_aux (LEXP_field (lexp, id), ul), exp) -> |
