David McNab
David McNab
I've given Early a good try today, but the lack of transparency makes debugging ~~very difficult~~ impossible. There's no equivalent to `parse_interactive()`, no ability to stream the tokens, rules and...
Thanks, @erezsh for the thoughts. You're right to question it - as it happens, subclassing `BasicLexer` dropped me into a worse rabbit hole. Anyway, I've pivoted to a whole different...
Nice milestone reached today, using the `StateBasedLexer` class, with all 5k+ lines of legacy code now landing in AST. It's been very easy to keep the lexer states harmonised with...
The API for `StateBasedLexer` is deceptively simple, and follows the regular pattern of the `Lark` constructor's `lexer` parameter being passed as a class, then instantiated within Lark, then its `.lex()`...
@erezsh will do. Meanwhile, you could consider a slight relaxation on validating `Lark`'s `lexer` constructor argument. As it is, it insists on custom lexers being a subclass of `Lexer`. In...
@erezsh thanks for that. I have been meaning to check out `.parse_interactive()`, but I've been a bit too tight-looped in my current project (well that's the official excuse anyway ;)...
I just tried it out, but noticed that the `.result` wasn't getting assigned with the parse tree. After a bit of stepping through LARK internals, I noticed the parser wasn't...
Current gcc version on Ubuntu[Studio] 22.04 LTS is: `gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0` As per your suggestion, I installed clang, removed the build/ directory, and tried to set up for a...
I could also mention that I use the same in-method multi-line string pattern for SQL queries, eg (hypothetically): ``` Class MyHandler: ... async def handle_foo(self, req): query = """ SELECT...
In my use case, I've had the SMTP listener spawned by systemd. The only way to close then re-open the port, is for the process to fall on its sword,...