rawparser

package
v0.0.0-...-ea924cd Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockContent

type BlockContent struct {
	Pos lexer.Position

	Entries []*Entry `@@*`
}

type BlockDirective

type BlockDirective struct {
	Pos lexer.Position

	Identifier string        `@Ident`
	Parameters []*Value      `@@*`
	Content    *BlockContent `"{" @@ "}"`
}

func (*BlockDirective) FindEntriesWithIdentifier

func (b *BlockDirective) FindEntriesWithIdentifier(identifier string) []*Entry

func (*BlockDirective) GetEntries

func (b *BlockDirective) GetEntries() []*Entry

func (*BlockDirective) GetParametersExpressions

func (b *BlockDirective) GetParametersExpressions() []string

type Comment

type Comment struct {
	Pos lexer.Position

	Value string `@Comment`
}

type Config

type Config struct {
	Pos lexer.Position

	Entries []*Entry `@@*`
}

type Directive

type Directive struct {
	Pos lexer.Position

	Identifier string   `@Ident`
	Values     []*Value `@@+";"`
}

func (*Directive) GetExpressions

func (d *Directive) GetExpressions() []string

func (*Directive) GetFirstValueStr

func (d *Directive) GetFirstValueStr() string

func (*Directive) GetValues

func (d *Directive) GetValues() []*Value

func (*Directive) SetValues

func (d *Directive) SetValues(expressions []string)

type Entry

type Entry struct {
	Pos lexer.Position

	StartNewLines  []string        `@NewLine*`
	Comment        *Comment        `( @@`
	Directive      *Directive      `| @@`
	BlockDirective *BlockDirective `| @@ )`
	EndNewLines    []string        `@NewLine*`
}

func (*Entry) GetIdentifier

func (e *Entry) GetIdentifier() string

type RawParser

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

func GetRawParser

func GetRawParser() (*RawParser, error)

func (*RawParser) Parse

func (p *RawParser) Parse(configPath string) (*Config, error)

type Value

type Value struct {
	Pos lexer.Position

	Expression string `@Expression | @String | @StringSingleQuoted`
}

Jump to

Keyboard shortcuts

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