Replies: 2 comments 3 replies
-
|
It sounds like Dart puts tokens in a doubly-linked list, so that they can get the ignore terminals that came before any given terminal and the preceding non-ignore terminal. This seems pretty easy to implement; we'd add a couple mutable fields to every token: public abstract class Terminal {
@Nullable
public Terminal prev, next;
public boolean wasIgnored = true;
...
}The lexer then keeps around the last token it produced, to link in the next one. Finally, the parser sets There are a few ways to expose this to Silver; the most direct one would be: Having this would make it easier to write an ignore-terminal-preserving |
Beta Was this translation helpful? Give feedback.
-
|
Silver debuggability enhancement: Further enhancement that's more work than it's worth, but might be a better fit for an optimizing compiler for a strict language: have a simple termination checker; when printing that stack trace, put a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Making a discussion for this because Slack #ideas disappears after a while...
Beta Was this translation helpful? Give feedback.
All reactions