fixed bug wih with_is_in_loop

This commit is contained in:
Moritz Gmeiner 2024-08-27 18:25:12 +02:00
commit 94ccf91689

View file

@ -11,8 +11,10 @@ type stmt_result = (stmt_node, parser_error) result
type expr_result = (expr_node, parser_error) result type expr_result = (expr_node, parser_error) result
let with_is_in_loop (f : state -> 'a) (state : state) : 'a = let with_is_in_loop (f : state -> 'a) (state : state) : 'a =
let state = { state with is_in_loop = true } in let new_state = { state with is_in_loop = true } in
f state let result = f new_state in
state.tokens <- new_state.tokens;
result
let make_state tokens = { tokens; is_in_loop = false } let make_state tokens = { tokens; is_in_loop = false }