{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
-{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Language.TCT.Read.Token where
LexemePairOpen ps -> foldl' open acc ps
where
-- NOTE: insert an empty node to encode <elem></elem>, not <elem/>
- open a p@(Cell _bp ep (PairElem{})) = openPair a p `appendPairsText` Cell ep ep ""
+ open a p@(Cell _bp ep PairElem{}) = openPair a p `appendPairsText` Cell ep ep ""
open a p = openPair a p
LexemePairClose ps -> foldl' closePair acc ps
LexemePairAny ps -> foldl' openPair acc ps
tagFrom (Cell bp ep t)
| (w,r) <- TL.span isTagChar t
, not $ TL.null w
- , ew <- pos_column bp + sum (Text.length <$> (TL.toChunks w)) =
+ , ew <- pos_column bp + sum (Text.length <$> TL.toChunks w) =
Just
( Cell bp bp{pos_column=ew} w
, Cell bp{pos_column=ew} ep r )