token

package
v0.23.0-test2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    Type
	Literal string
}

type Type

type Type uint8
const (
	ILLEGAL Type = iota
	EOL

	// Identifiers + literals.
	IDENT // add, foobar, x, y, ...
	INT   // 1343456
	FLOAT // 1. 1e3

	// Operators.
	ASSIGN
	PLUS
	MINUS
	BANG
	ASTERISK
	SLASH
	PERCENT

	LT
	GT
	// or equal variants.
	LTEQ
	GTEQ

	EQ
	NOTEQ

	// Delimiters.
	COMMA
	SEMICOLON

	LPAREN
	RPAREN
	LBRACE
	RBRACE
	LBRACKET
	RBRACKET
	COLON

	LINECOMMENT
	STARTCOMMENT
	ENDCOMMENT

	// Keywords.
	FUNCTION
	LET
	TRUE
	FALSE
	IF
	ELSE
	RETURN
	STRING
	MACRO
	// Built-in functions.
	LEN
	FIRST
	REST
	PRINT
	LOG
	EOF
)

func LookupIdent

func LookupIdent(ident string) Type

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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