docs(parser): add CST Structure section to README#473
Open
harshanacz wants to merge 1 commit into
Open
Conversation
Add a new 'CST Structure' subsection under 'Usage' with a concrete JSON example showing the Chevrotain CST output for a self-closing element (<xs:element name="api" />). The example accurately reflects the grammar rules in parser.js and the type definitions in api.d.ts. Closes SAP#470
b210a26 to
2923713
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new CST Structure subsection under Usage in
packages/parser/README.mdwith a comprehensive JSON example showing the Chevrotain CST output for nested XML elements.The example covers:
OPEN,Name,START_CLOSE,SLASH_OPEN,END_NAME,END)contentnode containing child elementsattribute(Name,EQUALS,STRING) andchardata(TEXT)SLASH_CLOSE)The structure accurately reflects:
packages/parser/lib/parser.jsElementCtx,AttributeCtx,ContentCtx, andChardataCtxtype definitions inpackages/parser/api.d.tsCloses #470