token

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string
const (
	EOF           Kind = "eof"
	Identifier    Kind = "identifier"
	Number        Kind = "number"
	String        Kind = "string"
	NativeLiteral Kind = "native_literal"
	Comment       Kind = "comment"
	Newline       Kind = "newline"
	Operator      Kind = "operator"
	Punct         Kind = "punctuation"
)

type Position

type Position struct {
	Offset int
	Line   int
	Column int
}

Position is a one-based source location with a zero-based byte offset.

func (Position) String

func (p Position) String() string

type Span

type Span struct {
	Start Position
	End   Position
}

Span is a half-open range in the original source.

type Token

type Token struct {
	Kind   Kind
	Lexeme string
	Span   Span
}

Token retains its exact spelling so formatters and source-to-source backends never need to reconstruct comments or literals.

Jump to

Keyboard shortcuts

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