appendLexeme :: Lexeme -> Pairs -> Pairs
appendLexeme lex acc =
dbg "appendLexeme" $
- case dbg "appendLexeme" lex of
+ case lex of
LexemePairOpen ps -> foldl' open acc ps
where
open a p@(Cell _bp ep (PairElem{})) = openPair a p `appendToken` (Cell ep ep $ TokenPlain "")
c@LexemePairClose{}:LexemePairAny p:acc -> c:LexemePairClose p:acc
-- ("
LexemePairAny p:o@LexemePairOpen{}:acc -> LexemePairOpen p:o:acc
+
+ -- "(
+ o@LexemePairOpen{}:LexemePairAny p:acc -> o:LexemePairClose p:acc
+ -- )"
+ LexemePairAny p:c@LexemePairClose{}:acc -> c:LexemePairClose p:acc
acc -> acc