-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
enhancementAn enhancement or new featureAn enhancement or new featurehelp welcomeCould use help from communityCould use help from communityparser
Description
In preparation for #3619 and #3620 I'd live to review out Emitter API and rename some things to better match our own internal naming. I think the original was a bit too specific with regards to internal implementations and the new version should be a little more abstract:
Old:
addKeyword(text, scope)
addText(text)
addSublanguage(emitter, subLanguageName)
finalize()
openNode(scope)
closeNode()
closeAllNodes()
toHTML()
New:
addText(text)
startScope(scope)
(or pushScope?)endScope()
(or popScope? or finishScope?)__addSublanguage(emitter, subLanguageName)
- (may stay private)finalize()
- thoughts on naming?toHTML()
Removed:
- pull back into an internal helperaddKeyword(text, scope)
- Lets just let finalize be responsible for all cleanup.closeAllNodes()
For writing custom grammar parsers one would really only need to concern themselves with 3 API calls I think:
- addText
- startScope
- endScope
@wooorm I know you had plenty of thoughts on this before... it's possible I'm a little more receptive now... I do plan on reducing a API a bit if we're going public (which I recall you pushed for previously).
Metadata
Metadata
Assignees
Labels
enhancementAn enhancement or new featureAn enhancement or new featurehelp welcomeCould use help from communityCould use help from communityparser