Adam Crume wrote:
>
> I have a parser with a prefix "-" and an infix "=". When I try to
> parse "x=-1", it fails. Does anyone know how to fix this?
> I stripped my code down as much as possible. It parses "x=1" and
> "-1", but fails for "x=-1".
I ran into simialr problems some time ago
Hi Adam,
> parse "x=-1", it fails. Does anyone know how to fix this?
This issue is in using the 'reservedOp' combinator which rejects '='
when followed by '-'.
reservedOp name =
lexeme $ try $
do{ string name
; notFollowedBy (opLetter languageDef) ("end of " ++ show n
I have a parser with a prefix "-" and an infix "=". When I try to
parse "x=-1", it fails. Does anyone know how to fix this?
I stripped my code down as much as possible. It parses "x=1" and
"-1", but fails for "x=-1".
import Text.Parsec
import qualified Text.Parsec.Expr as PE
impor
CMCS 2010
Call for Short Submissions & Call for Participation
The 10th International Workshop on Coalgebrai