parser

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package parser implements the parsing logic to obtain the sequence of inputs ready for processing. The two main thing it will do is to parse a regex-assembly file and recursively solve all `includes` first, then substitute all definitions where necessary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParsedLine

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

ParsedLine will store the results of parsing the line. `parsedType` will discriminate how you read the results: if the type is `include`, then the result map will store the file name in the "include" key. The definition type will just use the map for the name:value.

type Parser

type Parser struct {
	Flags    map[rune]bool
	Prefixes []string
	Suffixes []string
	// contains filtered or unexported fields
}

Parser is the base parser type. It will provide processors with all the inclusions and definitions resolved.

func NewParser

func NewParser(ctx *processors.Context, reader io.Reader) *Parser

NewParser creates a new parser from an io.Reader.

func (*Parser) Parse

func (p *Parser) Parse(formatOnly bool) (*bytes.Buffer, int)

Parse does the parsing and returns a buffer with all the bytes to process or an error if the reader could not be parsed.

Jump to

Keyboard shortcuts

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