caterwaul
caterwaul copied to clipboard
capturing inferred blocks based on indentation
Is there a mechanism to capture inferred blocks say i{
from indentation during lexing similar to the way the inferred semicolon i;
?
Guessing by the way catewaul parser works, it must be faster than other conventional parsers that double parse and push indent/outdent tokens, no?
Sadly there is no such mechanism right now. The caterwaul parser is so ad-hoc that it would probably be difficult to add support for it. However, it would probably not be difficult to write a simple parser in pegjs and have it generate custom trees. Then you could use the caterwaul macroexpander api with a custom syntax frontend. (This is what I'm planning on doing with the waul precompiler.) On Jan 11, 2012 6:04 AM, "rampall" < [email protected]> wrote:
Is there a mechanism to capture inferred blocks say
i{
from indentation during lexing similar to the way the inferred semicoloni;
?Guessing by the way catewaul parser works, it must be faster than other conventional parsers that double parse and push indent/outdent tokens, no?
Reply to this email directly or view it on GitHub: https://github.com/spencertipping/caterwaul/issues/1
I'll try that out and i'll keep an eye out for the waul precompiler updates.
I have to admit I am amazed (and intimidated at the same time) pouring through Caterwaul code and its acute case of over-documentation! Caterwaul is truly the beast - a magnificient one at that! Keep up the amazing work!