You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The semantics would be defined in the reader but I'm thinking:
If the entry has a table, look at the next char and see if the table has an entry for it and recurse.
If the entry has a table and an action, do 1 but only after running the action (for side-effects/setup).
If the entry has no table, just execute the action.
Maybe 2 is unnecessary or maybe the action just before the final table found should execute.
Motivation:
The current table-driven reader in sweet.js uses some simple tries for dealing w/ punctuators and keywords. This function could be built into the readtable implementation.
It would be useful to generalize dispatch macros and not have to hard-code a single character as the dispatch character.
For instance:
The semantics would be defined in the reader but I'm thinking:
Maybe 2 is unnecessary or maybe the action just before the final table found should execute.
Motivation:
The current table-driven reader in
sweet.js
uses some simple tries for dealing w/ punctuators and keywords. This function could be built into the readtable implementation.Now this would obviously be procedurally generated, but this illustrates the concept.
Note: Another way to achieve similar functionality would be to allow multi-char keys.
The text was updated successfully, but these errors were encountered: