lexer

package
v0.78.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlphaNum added in v0.40.1

func IsAlphaNum(ch byte) bool

Types

type Lexer

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

func New

func New(input string) *Lexer

Mode with input expected the be complete (multiline/file).

func NewBytes added in v0.27.0

func NewBytes(input []byte) *Lexer

Bytes based full input mode.

func NewLineMode

func NewLineMode(input string) *Lexer

Line by line mode, with possible continuation needed.

func (*Lexer) CurrentLine added in v0.53.0

func (l *Lexer) CurrentLine() (string, int, int)

For error handling, somewhat expensive. Returns the current line, the current position relative in that line and the current line number.

func (*Lexer) EOLEOF added in v0.47.0

func (l *Lexer) EOLEOF() *token.Token

func (*Lexer) HadNewline added in v0.27.0

func (l *Lexer) HadNewline() bool

func (*Lexer) HadWhitespace added in v0.25.0

func (l *Lexer) HadWhitespace() bool

func (*Lexer) LastNewLine added in v0.53.0

func (l *Lexer) LastNewLine() int

func (*Lexer) NextToken

func (l *Lexer) NextToken() *token.Token

func (*Lexer) Pos added in v0.53.0

func (l *Lexer) Pos() int

Jump to

Keyboard shortcuts

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