lexer

package
v0.95.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 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

New creates a lexer in mode with string input expected to be complete (multiline/file).

func NewBytes added in v0.27.0

func NewBytes(input []byte) *Lexer

NewBytes creates a lexer in bytes based full input mode.

func NewLineMode

func NewLineMode(input string) *Lexer

NewLineMode creates a lexer in line by line mode, with possible continuation needed.

func (*Lexer) CurrentLine added in v0.53.0

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

CurrentLine returns the current line as a string, the position within that line, and the current line number. Useful for error handling. This operation may be somewhat expensive.

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