Trace Output

1 view
Skip to first unread message

Graeme Defty

unread,
Sep 16, 2010, 7:33:09 AM9/16/10
to neoto...@googlegroups.com
Thing that would really help would be able to generate a trace of what the parser is doing, as a debugging aid for PEG development. With a large PEG (e.g. that of Reia) it is not always obvious why my rules don't match.

A runtime switch would be ideal, but I would settle for generating a special 'tracing' version of the scanner when I am deeply in the brown and smelly.

g

Sean Cribbs

unread,
Sep 16, 2010, 9:22:17 AM9/16/10
to neoto...@googlegroups.com
I did this at one point when trying to debug the switch over to
binaries instead of lists (which is still incomplete, ugh). We might
be able to do this with a simple macro, like ?DEBUG("some message")
where you can -define(DEBUG(_Msg), ok). to turn it off, or
-define(DEBUG(Msg), io:format(Msg)). to turn it on.
Reply all
Reply to author
Forward
0 new messages