parser

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package parser provides parsing utilities for the HoTT kernel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTerm

func FormatTerm(t ast.Term) string

FormatTerm formats an AST term as an S-expression string.

func MustParse

func MustParse(input string) ast.Term

MustParse parses a term or panics.

func Normalize

func Normalize(input string) string

Normalize removes extra whitespace and standardizes formatting.

func ParseMultiple

func ParseMultiple(input string) ([]ast.Term, error)

ParseMultiple parses multiple terms separated by whitespace.

func ParseTerm

func ParseTerm(input string) (ast.Term, error)

ParseTerm parses the input string as an AST term.

Types

type ParseError

type ParseError struct {
	Pos     int
	Message string
}

ParseError represents a parsing error with position information.

func (*ParseError) Error

func (e *ParseError) Error() string

type SExprParser

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

SExprParser parses S-expressions into AST terms.

func NewSExprParser

func NewSExprParser(input string) *SExprParser

NewSExprParser creates a new S-expression parser.

func (*SExprParser) Parse

func (p *SExprParser) Parse() (ast.Term, error)

Parse parses the input and returns an AST term.

Jump to

Keyboard shortcuts

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