
Hi! I'm writing a parser for a language, with a BNF like this: Type = "type" Def Def = RecordDef | RecordOfDef ... RecordDef = "record" Body RecordOfDef = "record" "of" With a perser what uses parsec module it can be mapped to haskell easily: structuredTypeDef = recordDef <|> recordOfDef But this way, the recordOfDef case will never be parsed at a line like "type record <somethings>", because recordDef will win in the first place always. Is there an option or an other operation instead of <|> to do the trick? I cant see if the problem can be solved with parsecperm or not. It is a possibility to do something like swap "recordDef <|> recordOfDef" with "recordlikeDefs " where recordlikeDefs = do { reserved "record" ; others } but that would be the dirty way... Do you have any advise on the case? Thanks, -- Zsolt Szalai