mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-15 19:28:47 +00:00
Merge remote-tracking branch 'origin/hw2'
* origin/hw2: Fixed common.ml/Syntax.ml Fixed common.mlyet again Fixed SM.run Added SM.run Fixed common.ml Sync Added CONST instruction
This commit is contained in:
commit
29cd925266
4 changed files with 281 additions and 7 deletions
|
|
@ -28,11 +28,11 @@ let eval _ = failwith "Not yet implemented"
|
|||
|
||||
(* Top-level evaluation
|
||||
|
||||
val run : prg -> int list -> int list
|
||||
val run : int list -> prg -> int list
|
||||
|
||||
Takes an input stream, a program, and returns an output stream this program calculates
|
||||
*)
|
||||
let run p i = let (_, (_, _, o)) = eval ([], (Expr.empty, i, [])) p in o
|
||||
let run i p = let (_, (_, _, o)) = eval ([], (Syntax.Expr.empty, i, [])) p in o
|
||||
|
||||
(* Stack machine compiler
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue