mirror of
https://github.com/MorizzG/MLox.git
synced 2025-12-06 04:22:41 +00:00
fixed parser bug by filtering out all comments
This commit is contained in:
parent
ea0d7acbee
commit
b4e25ee561
3 changed files with 23 additions and 14 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue