minor fixups

This commit is contained in:
Moritz Gmeiner 2024-08-29 02:57:58 +02:00
commit f4ddaeb11d
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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>"]
body : Stmt.stmt_node;
}
and native_function = {