Help us shape the future of Go! Take the 2026 Go Developer Survey

parser

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package parser implements the stateful block parser used by the public asciidoc package facade.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser coordinates the line lexer and construction-specific parsers. A Parser consumes its reader and is intended for one call to Parse.

func New

func New(reader io.Reader) *Parser

New creates a parser that reads from reader.

func (*Parser) Parse

func (p *Parser) Parse() Result

Parse consumes the input and returns its partial or complete syntax tree and diagnostics. Calling Parse more than once produces an error result.

type Result

type Result struct {
	Document    *ast.Document
	Diagnostics []diagnostic.Diagnostic
}

Result contains the partial or complete AST and every diagnostic produced while parsing. Document is always non-nil.

func (Result) HasErrors

func (r Result) HasErrors() bool

HasErrors reports whether at least one error diagnostic was produced.

Jump to

Keyboard shortcuts

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