parser

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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. Surrounding whitespace is dropped first: {{ expr }} is the documented form, and the lexer reads a leading space as an indent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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