Skip to content

Commit

Permalink
Stupid workaround for a bug
Browse files Browse the repository at this point in the history
Because character set comparison is partial, sort doesn't always work.
For now use a silly hack.
  • Loading branch information
lierdakil committed Aug 4, 2023
1 parent d8d7a3e commit 71752b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Lexer/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sortCharPatterns = sortBy (cmp `on` fst)
cmp a b | bina && ainb = EQ
| bina = GT
| ainb = LT
| otherwise = EQ
| otherwise = compare (length a) (length b)
where ainb = contains' b a
bina = contains' a b
contains' a b = all (\bi -> any (`containsCR` bi) (NE.toList a)) (NE.toList b)
Expand Down

0 comments on commit 71752b0

Please sign in to comment.