Documentation
¶
Overview ¶
Package parser implements TypeRB's handwritten recursive-descent and Pratt parsers. The syntax tree is independent from parser internals and retains source spans for diagnostics, formatting, and Ruby interoperability.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSXComponentIdentifierAt ¶ added in v0.3.2
JSXComponentIdentifierAt returns the component identifier under an editor cursor. JSX is lexed as one literal token, so semantic tooling uses the JSX parser's component-name boundaries instead of duplicating JSX syntax rules.
func NormalizeRubyNativeParameters ¶ added in v0.3.28
NormalizeRubyNativeParameters applies Ruby's untyped keyword-parameter interpretation only after an explicit Ruby-native import has selected that syntax. Portable parsing remains deterministic and keeps the candidate metadata separate until this point.
func Parse ¶
func Parse(source []byte) (*ast.Program, []diagnostic.Diagnostic)
func ParseJSXToken ¶ added in v0.3.15
func ParseJSXToken(root token.Token) (*ast.JSXElement, bool)
ParseJSXToken rebuilds the structured JSX node represented by one lossless lexer token. Tooling that prints token-preserving source can use the shared JSX grammar without duplicating it.