Hi

I'm currently writing a little example mode for Yi and I'd like to
verify that the parser works as it should.  However, I can't figure
out how to trace the resulting AST without implementing dummy stroking
functionality.  Below is the code I'm currently using, but I have to
replace "XYZ" with something which actually "performs" the parsing and
returns the AST, so that I can "show" it.

parser = let res = program <* eof in trace (show $ XYZ $ res) res

program = PIdent <$> pId <*> program
      <|> POper <$> pOp
      <|> PErr <$> recoverWith (symbol (const True))

-- 
Deniz Dogan

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to