Initial state - basic lexer + parser + interpreter
This commit is contained in:
13
lib/read.ml
Normal file
13
lib/read.ml
Normal file
@@ -0,0 +1,13 @@
|
||||
let parse_one lb = Parser.prog (Lexer.read) lb
|
||||
|
||||
let parse lb =
|
||||
let rec helper () =
|
||||
match parse_one lb with
|
||||
| None -> []
|
||||
| Some (t) -> t :: helper ()
|
||||
in
|
||||
helper ()
|
||||
|
||||
let parse_str s =
|
||||
parse (Lexing.from_string s)
|
||||
|
Reference in New Issue
Block a user