mirror of
https://github.com/ProgramSnail/Lama.git
synced 2026-01-02 12:08:20 +00:00
Pre-parsing
This commit is contained in:
commit
b8fb21720c
1 changed files with 1 additions and 2 deletions
|
|
@ -44,7 +44,7 @@ let rec eval ((stack, ((st, i, o) as c)) as conf) = function
|
||||||
Takes an input stream, a program, and returns an output stream this program calculates
|
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 p i = let (_, (_, _, o)) = eval ([], (Expr.empty, i, [])) p in o
|
||||||
|
|
||||||
(* Stack machine compiler
|
(* Stack machine compiler
|
||||||
|
|
||||||
val compile : Language.Stmt.t -> prg
|
val compile : Language.Stmt.t -> prg
|
||||||
|
|
@ -52,7 +52,6 @@ let run p i = let (_, (_, _, o)) = eval ([], (Expr.empty, i, [])) p in o
|
||||||
Takes a program in the source language and returns an equivalent program for the
|
Takes a program in the source language and returns an equivalent program for the
|
||||||
stack machine
|
stack machine
|
||||||
*)
|
*)
|
||||||
|
|
||||||
let rec compile =
|
let rec compile =
|
||||||
let rec expr = function
|
let rec expr = function
|
||||||
| Expr.Var x -> [LD x]
|
| Expr.Var x -> [LD x]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue