diff --git a/lib/parser.ml b/lib/parser.ml index e4a1cfd..a5be2e6 100644 --- a/lib/parser.ml +++ b/lib/parser.ml @@ -79,7 +79,7 @@ let collect_chain (tts : token_type array) (collector : state -> ('a, parser_err in collect_chain_rec [] |> Result.map List.rev -let primary (state : state) : expr_result = +let atom (state : state) : expr_result = let pos = cur_pos state in match peek_tt state with | Number x -> @@ -115,7 +115,7 @@ let rec grouping (state : state) : expr_result = let tt = peek_tt state in let msg = Printf.sprintf "Expected RightParen, got %s instead" (show_token_type tt) in Error { pos; msg }) - else primary state + else atom state and call (state : state) : expr_result = let* expr = grouping state in diff --git a/lib/value.ml b/lib/value.ml index ecb7f81..1fe9582 100644 --- a/lib/value.ml +++ b/lib/value.ml @@ -3,7 +3,7 @@ type lox_function = { env : environment; arity : int; arg_names : string list; - body : Stmt.stmt_node; [@printer fun fmt _ -> fprintf fmt ""] + body : Stmt.stmt_node; } and native_function = {