Help us shape the future of Go! Take the 2026 Go Developer Survey

lexer

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Overview

Package lexer turns source bytes into tokens.

Phase 0 carries the seeds of MRI's stateful lexer — SpaceBefore on every token and a lexState field — without yet exercising the hard cases (regex vs division, heredocs, interpolation). Those land in later phases (plan §10); the state plumbing is here from the start so they slot in without a rewrite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

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

func New

func New(src string) *Lexer

func (*Lexer) Tokenize

func (l *Lexer) Tokenize() []token.Token

Tokenize returns the full token stream, terminated by an EOF token.

Jump to

Keyboard shortcuts

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