Working as a software engineer is much more than writing code. There is complexity every area of the job, and that is why we need to keep the code as simple as possible. But that is not an easy job.
Defining the classes of an AST can be cumbersone due to the high amount of nodes and redundant code. Dynamic classes in JS can make this process much easier.
Autocompletion has a fatal flaw. If there is a syntax error somewhere before the cursor, the machine will fail and never reach it, even if it has more than enough context to guess the next tokens.
But what if we could define recovery rules? A way for it to reset when it fails and keep going.
At first glance, rules might seem like a odd and complex mechanism, specially since they allow recursion. But once looked in detail, it's just like any other type of transition, with a few quirks.