lexer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package lexer implements the lexical scanner for the Meow language. It converts source text into a stream of tokens using iter.Seq.

Usage

l := lexer.New(source, "hello.nyan")
for tok := range l.Tokens() {
    fmt.Println(tok.Type, tok.Literal)
}

The lexer handles all Meow token types including cat-themed keywords, operators (such as the |=| pipe), string/number/boolean literals, line comments (#) and block comments (-~ ... ~-).

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
}

Lexer tokenizes Meow source code.

func New

func New(input, file string) *Lexer

New creates a new Lexer for the given source.

func (*Lexer) Tokens

func (l *Lexer) Tokens() iter.Seq[token.Token]

Tokens returns an iterator over all tokens in the source.

Jump to

Keyboard shortcuts

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