lexer

package
v0.0.0-...-d493fdc Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	AllowComments:    true,
	StringDelimiters: []byte{'"'},
}

DefaultLexerConfig defines default settings for the lexer

Functions

This section is empty.

Types

type Config

type Config struct {
	AllowComments    bool
	StringDelimiters []byte
}

LexerConfig provides configuration options for the lexer

type Lexer

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

Lexer performs lexical analysis on the input source code

func New

func New(input string, config Config) *Lexer

New creates a new Lexer instance with the provided configuration

func (*Lexer) NextToken

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

NextToken retrieves the next token from the input

Jump to

Keyboard shortcuts

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