parser

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModifierError

type ModifierError struct {
	File     string
	Pos      ast.Position
	Modifier common.Modifier
	Context  string
}

ModifierError represents errors related to invalid modifier usage

func (ModifierError) Error

func (e ModifierError) Error() string

type ParseError

type ParseError struct {
	File       string
	Pos        ast.Position
	Msg        string
	SourceLine string
	Token      lexer.Item
}

ParseError includes file and precise position for better diagnostics.

func (ParseError) Error

func (e ParseError) Error() string

type Parser

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

func New

func New(items []lexer.Item) *Parser

func NewWithFile

func NewWithFile(items []lexer.Item, file string) *Parser

func NewWithSource

func NewWithSource(items []lexer.Item, file string, source string) *Parser

NewWithSource creates a parser with source code for better error messages

func (*Parser) Parse

func (p *Parser) Parse() (*ast.Program, error)

Parse program: sequence of statements until EOF.

func (*Parser) ParseExpression added in v1.1.3

func (p *Parser) ParseExpression() (ast.Expr, error)

ParseExpression parses a single expression from the token stream This is useful for parsing interpolation expressions and other standalone expressions

type PrivacyError

type PrivacyError struct {
	File    string
	Pos     ast.Position
	Privacy common.PrivacyLevel
	Context string
}

PrivacyError represents errors related to invalid privacy level usage

func (PrivacyError) Error

func (e PrivacyError) Error() string

Jump to

Keyboard shortcuts

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