4 ms·
Now do indentation-based. All parser libraries tend to trip on this small, yet widely relevant, feature. To be honest, most parser libraries should at least inc
by jakearmitage 5y ago
Now do indentation-based. All parser libraries tend to trip on this small, yet widely relevant, feature. To be honest, most parser libraries should at least include a Python sample as some sort of acid test.
- codethief 5y agoI have never used Chumsky before but the tutorial has the following to say about whitespace: > Whitespace is not automatically ignored. Chumsky is a general-purpose parsing library, and some languages care very much about the structure of whitespace, so Chumsky does too
- zesterer 5y agoI have some thoughts about this: https://github.com/zesterer/chumsky/issues/20#issuecomment-960639209 https://github.com/zesterer/chumsky/issues/20#issuecomment-9... TL;DR: The best approach, in my view, is to detect whitespace in the lexer and emit fake delimiter tokens for the parser so that the parser-level syntax is still context-free.