fixed parser bug by filtering out all comments

This commit is contained in:
Moritz Gmeiner 2024-08-25 03:07:18 +02:00
commit b4e25ee561
3 changed files with 23 additions and 14 deletions

View file

@ -1,6 +1,9 @@
type stmt = Expr of Expr.expr_node | Print of Expr.expr_node
and stmt_node = { stmt : stmt; pos : Error.code_pos }
let show_stmt stmt =
match stmt with Expr expr -> Expr.show_expr expr.expr | Print expr -> Expr.show_expr expr.expr
let make_expr_stmt (pos : Error.code_pos) (expr : Expr.expr_node) : stmt_node =
let stmt = Expr expr in
{ stmt; pos }