feat: Add typecheck to the AST

This commit is contained in:
Lucàs
2024-07-05 00:06:32 +02:00
parent 0a42fbe3dc
commit d81b96779a
17 changed files with 234 additions and 39 deletions
+1 -1
View File
@@ -3,4 +3,4 @@
(executable
(name main)
(public_name croissant)
(libraries analyzer ast))
(libraries ast))
+2 -2
View File
@@ -1,7 +1,7 @@
(* bin/main.ml *)
open Printf
open Ast.Print
open Ast
exception Error of string
@@ -12,7 +12,7 @@ let () =
if args_count >= 2 then printf "%s" help_message
else if args_count = 1 then
let file_path = Sys.argv.(1) in
let ast = string_of_source_file (Analyzer.analyze_file file_path) in
let ast = Print.string_of_source_file (Analyzer.analyze_file file_path) in
printf "%s\n" ast
else raise (Error "interpreter from stdin is not implemented yet")
(* TODO: Implement interpreter from stdin *)