lexer

package
v0.0.0-...-f420c12 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoDescription = ShowType(3)
View Source
var PossibleDescription = ShowType(0)
View Source
var ShowBlockDescription = ShowType(2)
View Source
var ShowStringDescription = ShowType(1)

Functions

func Put

func Put(l *Lexer)

Types

type Description

type Description struct {
	ShowType ShowType
	Text     string
	Loc      Location
}

func (Description) String

func (d Description) String() string

type Lexer

type Lexer struct {
	SkipDescriptions bool
	// contains filtered or unexported fields
}

func Get

func Get(s string) *Lexer

func (*Lexer) CatchSyntaxError

func (l *Lexer) CatchSyntaxError(f func()) (errRes error)

func (*Lexer) Consume

func (l *Lexer) Consume()

Consume whitespace and tokens equivalent to whitespace (e.g. commas and comments).

Consumed comment characters will build the description for the next type or field encountered. The description is available from `DescComment()`, and will be reset every time `Consume()` is executed.

func (*Lexer) ConsumeDescription

func (l *Lexer) ConsumeDescription() (d Description)

func (*Lexer) ConsumeIdentIntern

func (l *Lexer) ConsumeIdentIntern() string

func (*Lexer) ConsumeIdentInternWithLoc

func (l *Lexer) ConsumeIdentInternWithLoc() (string, Location)

func (*Lexer) ConsumeKeyword

func (l *Lexer) ConsumeKeyword(keywords ...string) string

func (*Lexer) ConsumeLiteral

func (l *Lexer) ConsumeLiteral() string

func (*Lexer) ConsumeString

func (l *Lexer) ConsumeString() string

func (*Lexer) ConsumeToken

func (l *Lexer) ConsumeToken(expected rune)

func (*Lexer) Location

func (l *Lexer) Location() Location

func (*Lexer) Peek

func (l *Lexer) Peek() rune

func (*Lexer) PeekKeyword

func (l *Lexer) PeekKeyword(keyword string) bool

func (*Lexer) SyntaxError

func (l *Lexer) SyntaxError(message string)

type Location

type Location = qerrors.Location

type ShowType

type ShowType byte

Jump to

Keyboard shortcuts

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