lex

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

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 NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() Token

type Token

type Token struct {
	Type     TokenType
	Literal  string
	Position int
	Value    any // For numbers (*big.Int), strings (string), bytestrings ([]byte)
}

type TokenType

type TokenType int
const (
	TokenEOF TokenType = iota
	TokenError
	TokenLParen       // (
	TokenRParen       // )
	TokenLBracket     // [
	TokenRBracket     // ]
	TokenDot          // .
	TokenComma        // ,
	TokenNumber       // e.g., 123
	TokenIdentifier   // e.g., x, addInteger
	TokenString       // e.g., "hello"
	TokenByteString   // e.g., #aaBB
	TokenPoint        // e.g., 0xc0000
	TokenTrue         // True
	TokenFalse        // False
	TokenUnit         // ()
	TokenLam          // lam
	TokenDelay        // delay
	TokenForce        // force
	TokenBuiltin      // builtin
	TokenConstr       // constr
	TokenCase         // case
	TokenCon          // con
	TokenErrorTerm    // error
	TokenProgram      // program
	TokenList         // list
	TokenPair         // pair
	TokenI            // I
	TokenB            // B
	TokenPlutusList   // List
	TokenMap          // Map
	TokenPlutusConstr // Constr
)

Jump to

Keyboard shortcuts

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