mirror of
https://github.com/LucasVbr/croissant.git
synced 2026-05-13 17:12:10 +00:00
feat: Support basic expression
This commit is contained in:
+19
-1
@@ -1 +1,19 @@
|
||||
let () = print_endline "Hello, World!"
|
||||
(* bin/main.ml *)
|
||||
|
||||
open Printf
|
||||
open Ast
|
||||
|
||||
let () =
|
||||
let lexbuf = Lexing.from_channel stdin in
|
||||
let res =
|
||||
try Parser.main Lexer.token lexbuf with
|
||||
| Lexer.Error c ->
|
||||
fprintf stderr "Lexical error at line %d: Unknown character '%c'\n"
|
||||
lexbuf.lex_curr_p.pos_lnum c;
|
||||
exit 1
|
||||
| Parser.Error ->
|
||||
fprintf stderr "Parse error at line %d:\n" lexbuf.lex_curr_p.pos_lnum;
|
||||
exit 1
|
||||
in
|
||||
let _ = res in
|
||||
Printf.printf "%s\n" (string_of_source_file res)
|
||||
Reference in New Issue
Block a user