parser

package
v0.3.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 8 Imported by: 0

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

func JSXComponentIdentifierAt(root token.Token, cursor int) (token.Token, bool)

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 Parse

func Parse(source []byte) (*ast.Program, []diagnostic.Diagnostic)

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL