Miniml#30
Conversation
|
|
||
| let initial_env = [ "print", VBuiltin builtin_print ] | ||
|
|
||
| let rec check_env key env : value StateError.t = |
There was a problem hiding this comment.
Using function is recommended
|
|
||
| let is_keyword_next_helper input key = | ||
| let k_len = String.length key in | ||
| if not (String.starts_with ~prefix:key input) |
There was a problem hiding this comment.
Executing 'if ... then false' smells bad
| let k_len = String.length key in | ||
| if not (String.starts_with ~prefix:key input) | ||
| then false | ||
| else if String.length input == k_len |
There was a problem hiding this comment.
Executing 'if ... then true' smells bad
| let k_len = String.length key in | ||
| if not (String.starts_with ~prefix:key input) | ||
| then false | ||
| else if String.length input == k_len |
|
|
||
| let initial_env = [ "print", VBuiltin builtin_print ] | ||
|
|
||
| let rec check_env key env : value StateError.t = |
There was a problem hiding this comment.
Using function is recommended
|
|
||
| let is_keyword_next_helper input key = | ||
| let k_len = String.length key in | ||
| if not (String.starts_with ~prefix:key input) |
There was a problem hiding this comment.
Executing 'if ... then false' smells bad
| let k_len = String.length key in | ||
| if not (String.starts_with ~prefix:key input) | ||
| then false | ||
| else if String.length input == k_len |
There was a problem hiding this comment.
Executing 'if ... then true' smells bad
| let k_len = String.length key in | ||
| if not (String.starts_with ~prefix:key input) | ||
| then false | ||
| else if String.length input == k_len |
| @@ -0,0 +1,37 @@ | |||
| [@@@ocaml.text "/*"] | |||
There was a problem hiding this comment.
File 'KalashnikovAndrey/lib/Printer.ml' doesn't have corresponding .mli interface
|
|
||
| let rec check_env key : env -> value StateError.t = function | ||
| | [] -> StateError.fail (Var_unbound key) | ||
| | (k, v) :: rest -> if k = key then StateError.return v else check_env key rest |
There was a problem hiding this comment.
Prefer guard instead of if-then-else in case construction
|
Документация и тестовое покрытие (90.85%) должны скоро появиться. https://kakadu.github.io/fp25/docs/KalashnikovAndrey https://kakadu.github.io/fp25/cov/KalashnikovAndrey 2026-04-04 14:19 |
|
Linter report from 2026-04-04 14:20, for mini language KalashnikovAndrey |
interpreter miniml
author: Kalashnikov Andrey