ply custom token precedence

158 views
Skip to first unread message

Robert Grosse

unread,
Mar 29, 2013, 11:49:32 PM3/29/13
to ply-...@googlegroups.com
I suggest adding a way to provide a custom precedence for the token regexs. I'm currently stuck because as far as I can tell, there isn't one.

Currently, it always sorts by the first line number of the function, which is nice if you're defining  the functions manually, but a huge pain if you're defining the rules programmatically. Since foo.__code__.co_firstlineno is a readonly attribute, there is no way at all to specify the regex precedence.

Providing explicit methods rather than relying on function internals might also make the code more portable.
Reply all
Reply to author
Forward
0 new messages