Skip to content

Commit

Permalink
add incomplete tile oblig, fix #103
Browse files Browse the repository at this point in the history
  • Loading branch information
dm0n3y committed Jan 25, 2025
1 parent fe26f93 commit b26c4f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/structure/Oblig.re
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ module Ord = {
| Missing_tile // ghost tile
| Incon_meld // pre/postfix grout
| Extra_meld // infix grout
| Incomplete_tile
| Unmolded_tok
| Reserved_keyword;

// low to high severity
let all = [
Missing_meld,
Missing_tile,
Incomplete_tile,
Unmolded_tok,
Incon_meld,
Extra_meld,
Expand Down Expand Up @@ -48,7 +50,8 @@ let of_token = (tok: Token.t) =>
Label.is_const(lbl) && Label.is_complete(tok.text, lbl)
) =>
Some(Reserved_keyword)
| _ when !Label.is_complete(tok.text, lbl) => Some(Missing_tile)
| _ when !Label.is_complete(tok.text, lbl) =>
Some(tok.text == "" ? Missing_tile : Incomplete_tile)
| _ => None
};
};
Expand All @@ -68,6 +71,7 @@ module Delta = {

let not_hole = (map: t) =>
snd(find(Missing_tile, map)) > 0
|| snd(find(Incomplete_tile, map)) > 0
|| snd(find(Incon_meld, map)) > 0
|| snd(find(Extra_meld, map)) > 0;

Expand Down

0 comments on commit b26c4f9

Please sign in to comment.