tokens

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Undefined interfaces.TokenType = iota
	Identifier
	Int
	Double
	String
	Plus
	Minus
	Star
	Slash
	Percent
	Less
	LessEqual
	Greater
	GreaterEqual
	Equal
	EqualEqual
	Bang
	BangEqual
	ParenOpen
	ParenClose
	BraceOpen
	BraceClose
	Dot
	Comma
	Semicolon
	Colon
	BracketOpen
	BracketClose

	Eof

	True
	False
	Let
	Func
	And
	Or
	If
	Else
	While
	Return
	Import
	From
	As
	Exec

	IntType
	DoubleType
	StringType
	VoidType

	Struct
)

Variables

View Source
var Keywords = map[string]interfaces.TokenType{
	"let":    Let,
	"func":   Func,
	"if":     If,
	"else":   Else,
	"and":    And,
	"or":     Or,
	"true":   True,
	"false":  False,
	"while":  While,
	"int":    IntType,
	"double": DoubleType,
	"str":    StringType,
	"void":   VoidType,
	"return": Return,
	"struct": Struct,
	"import": Import,
	"from":   From,
	"as":     As,
	"exec":   Exec,
}

Functions

This section is empty.

Types

type Token

type Token struct {
	interfaces.SourceLocation
	Type    interfaces.TokenType
	Lexeme  string
	Literal string
}

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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