parser

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package parser is a hand-written recursive-descent parser for the Runefile declarative grammar, with a Pratt sub-parser (expr.go) for the expression sublanguage. It consumes the lexer's token stream and produces an *ast.File, emitting spanned diagnostics on any error (Principle II).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(file, src string) (*ast.File, diag.List)

Parse lexes and parses src (named file) into an *ast.File plus all lexical and syntactic diagnostics.

func ParseExprFragment

func ParseExprFragment(file, src string) (ast.Expr, diag.List)

ParseExprFragment parses a standalone expression (e.g. the contents of a {{ ... }} interpolation). It returns the expression and any diagnostics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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