I'm working on updating the Caddyfile lexer, to fix bugs and support new syntax features we've implemented in the past couple years.
We've added heredocs support https://caddyserver.com/docs/caddyfile/concepts#heredocs. I'm trying to figure out how to implement this in the lexer.
How do I store the heredoc marker (the part after <<), push into a "heredoc" state, and then pop the stack once that same string is found again? Is there somekind of storage mechanism in the state?
I see that Raku uses a custom mutator func. Is that my only option? Looks complicated.
I also noticed that since last time I contributed, most of the lexers got translated to XML. Is this something we should aim to do (tbh, ew 😬 looks like much worse UX to develop than the Go DSL) or is it fine for me to keep using Go?
I'm working on updating the Caddyfile lexer, to fix bugs and support new syntax features we've implemented in the past couple years.
We've added heredocs support https://caddyserver.com/docs/caddyfile/concepts#heredocs. I'm trying to figure out how to implement this in the lexer.
How do I store the heredoc marker (the part after
<<), push into a"heredoc"state, and then pop the stack once that same string is found again? Is there somekind of storage mechanism in the state?I see that Raku uses a custom mutator func. Is that my only option? Looks complicated.
I also noticed that since last time I contributed, most of the lexers got translated to XML. Is this something we should aim to do (tbh, ew 😬 looks like much worse UX to develop than the Go DSL) or is it fine for me to keep using Go?