aboutsummaryrefslogtreecommitdiff
path: root/motus/js/reload.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-06-21 09:29:20 +0200
committerSébastien Dailly <sebastien@dailly.me>2026-06-21 09:29:20 +0200
commite455d580ab4d837122a4186627ec109c4000d7c5 (patch)
tree37e6292ae1d6a31f57e6b7cdbedf8e11e257aa5c /motus/js/reload.ml
parent5709ce369f815ca26d555a05e84cfd0b8dc311cf (diff)
Motus: detect if one letter in the proposition match a rule in a different locationHEADmaster
Diffstat (limited to 'motus/js/reload.ml')
-rw-r--r--motus/js/reload.ml21
1 files changed, 9 insertions, 12 deletions
diff --git a/motus/js/reload.ml b/motus/js/reload.ml
index 912141d..2a12819 100644
--- a/motus/js/reload.ml
+++ b/motus/js/reload.ml
@@ -8,28 +8,25 @@ let process : t -> State.state -> State.state =
fun () state ->
(* Get the word corresponding to the proposition *)
let word =
- state.State.current_prop
- |> List.to_seq
+ state.State.current_prop |> List.to_seq
|> Seq.map (fun opt ->
- match opt with
- | None -> ' '
- | Some (letter, _) -> String.get (Jstr.to_string letter) 0 )
+ match opt with
+ | None -> ' '
+ | Some (letter, _) -> String.get (Jstr.to_string letter) 0)
|> String.of_seq
in
let new_state =
- { state with
- analysis = Motus_lib.Wordlist.remove_word state.analysis word
+ {
+ state with
+ candidates = Motus_lib.Wordlist.remove_word state.candidates word
; catalog = Motus_lib.Wordlist.remove_word state.catalog word
}
in
(* Get the new proposition if any *)
let current_prop =
- Initialize.get_proposition
- ~catalog:new_state.catalog
- state.length
- new_state.analysis
- state.rules
+ Initialize.get_proposition ~catalog:new_state.catalog state.length
+ new_state.candidates state.rules
in
match current_prop with
| None -> new_state