mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-05 06:07:21 +03:00
fix issue with Semi insertion by the lexer, down to 11 failures
This commit is contained in:
parent
d817d60c7b
commit
e080d7f594
@ -171,7 +171,12 @@ reorder ts = join . sortWith f . stanzas $ ts
|
||||
lexer :: String -> String -> [Token Lexeme]
|
||||
lexer scope rem =
|
||||
let t = tree $ lexer0 scope rem
|
||||
in toList $ reorderTree reorder t
|
||||
-- after reordering can end up with trailing semicolon at the end of
|
||||
-- a block, which we remove with this pass
|
||||
fixup ((payload -> Semi) : t@(payload -> Close) : tl) = t : fixup tl
|
||||
fixup [] = []
|
||||
fixup (h : t) = h : fixup t
|
||||
in fixup . toList $ reorderTree reorder t
|
||||
|
||||
lexer0 :: String -> String -> [Token Lexeme]
|
||||
lexer0 scope rem =
|
||||
|
Loading…
Reference in New Issue
Block a user