Yes, it should but it also might introduce new bugs. /Anders K
On Mon, Aug 10, 2009 at 3:14 PM, Jean-Philippe Bernardy<jeanphilippe.berna...@gmail.com> wrote: > > So, using pCBrace ... pEmpty should solve this, right? > > -- JP > > On Mon, Aug 10, 2009 at 3:09 PM, Anders Karlsson<anders...@gmail.com> wrote: >> >> -- | Parse a Do block >> pDo :: Parser TT (Exp TT) >> pDo = Bin <$> pAtom [Reserved Do] >> <*> pBlock (pExpr ((Special ';' : recognizedSometimes) \\ >> [ReservedOp >> LeftArrow])) >> >> pBlock :: Parser TT [Exp TT] → Parser TT (Exp TT) >> pBlock p = pBlockOf' (Block <$> pBlocks' p) >> <|> pBrace (concat <$> (p `sepBy1` exact [Special ';']) <|> pure []) >> <|> (Yuck $ Enter "block expected" $ pEmptyBL) >> >> Either the comment inside of the block {} belongs to the left { >> (pBrace) or it is parsed >> as an pElem since comments are parsed as atoms in pElem i think... a >> solution to this >> specific problem might be using >> >> pBlock :: Parser TT [Exp TT] → Parser TT (Exp TT) >> pBlock p = pBlockOf' (Block <$> pBlocks' p) >> <|> pCBrace (concat <$> (p `sepBy1` exact [Special ';']) <|> >> pure []) pEmpty >> <|> (Yuck $ Enter "block expected" $ pEmptyBL) >> >> instead, but that might break other patterns so that the parser fail >> if a comment >> is located after a { >> >> /Anders K >> >> On Mon, Aug 10, 2009 at 2:52 PM, <codesite-nore...@google.com> wrote: >>> >>> >>> Comment #1 on issue 284 by JeanPhilippe.bernardy: Precise haskell mode: >>> Explicit structuring often allow 2 ways to parse comments >>> http://code.google.com/p/yi-editor/issues/detail?id=284 >>> >>> What are the two ways in which it can be parsed? >>> >>> -- >>> You received this message because you are listed in the owner >>> or CC fields of this issue, or because you starred this issue. >>> You may adjust your issue notification preferences at: >>> http://code.google.com/hosting/settings >>> >>> > >>> >> >> > >> > > > > --~--~---------~--~----~------------~-------~--~----~ Yi development mailing list yi-devel@googlegroups.com http://groups.google.com/group/yi-devel -~----------~----~----~----~------~----~------~--~---