-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Motivation:
The sweet.js table-driven reader uses simple tries to do determine value or the value property on KeywordTokens and PunctuatorTokens. It's fast and it works, but it would be more user-friendly to allow:
const tEntries = [{
key: 'this',
action(stream) {
return KeywordToken({ value: stream.readString(4); });
}
}, {
key: 'throw',
action(stream) {
return KeywordToken({ value: stream.readString(5); });
}
}];As stated in #2 this would be done procedurally but for user defined reader macros this could be a huge usability win.
This could potentially also do away with the idea of dispatch macros.
const hashEntries = [{
key: '#',
action: readPrivateVars
}, {
key: '#`',
action: readSyntaxTemplate
}]@disnet any thoughts?
Metadata
Metadata
Assignees
Labels
No labels