You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dataLineContent=LineContentTextString
| LineContentIdentifierStringderiving (Show)
lineParser::MonadCatchm=>ParsermCharLine
lineParser =Parser.many content Fold.toList
where
identifierSimple =Parser.some (alphaNumP `alt_` charP '\''`alt_` charP '_') Fold.toList
identifierInBraces = charP '{'*> identifierSimple <* charP '}'
identifier =fmapLineContentIdentifier$ charP '$'*> (identifierInBraces `alt_` identifierSimple)
escapedDollar =fmap (LineContentText. (:[])) $ charP '$'*> charP '$'-- "Parser.count" is undefined. The current implementation eats the-- malformed '$' instead of erroring out. This should be fixed if 'count' is-- used.-- escapedDollar =-- fmap LineContentText-- $ charP '$' *> Parser.count 1 (charP '$') Fold.toList
anySingle =Parser.satisfy (constTrue)
end =
void (Parser.lookAhead escapedDollar)
`alt_` void (Parser.lookAhead identifier)
`alt_`Parser.eof
contentText =LineContentText<$>Parser.manyTill anySingle end Fold.toList
content = escapedDollar `alt_` identifier `alt_` contentText
With alt_ = (<|>), the ParserK alternative, the last identifier is not parsed
properly. The rest of the input returned by parse_ is also improper because of
the incorrect parsing.
With alt_ = alt, the ParserD alternative, few identifiers are reversed.
Activity
adithyaov commentedon Sep 15, 2022
Bug in the interconversion of parsers,
The above does not produce expected result.
EDIT: This was solved.
adithyaov commentedon Sep 16, 2022
See #1838