token

package
v0.0.0-...-44ce166 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 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 Token

type Token struct {
	Type    TokenType
	Literal string

	Err error
	// contains filtered or unexported fields
}

func Error

func Error(err error) Token

func (Token) String

func (t Token) String() string

type TokenType

type TokenType int
const (
	EOF TokenType = iota
	Invalid
	Ident
	Number
	ReactionChain      // |
	ReactionDef        // :
	ReactionOp         // =>
	If                 // if
	LessThan           // <
	GreaterThan        // >
	LessThanOrEqual    // <=
	GreaterThanOrEqual // >=
	Equal              // ==
	NotEqual           // !=
	Not                // !
	Or                 // ||
	And                // &&
	Plus               // +
	Subtract           // -
	Multiply           // *
	Divide             // /
	Modulo             // %
	Comma              // ,
	OpenBracket        // (
	CloseBracket       // )
	OpenCurlyBracket   // {
	CloseCurlyBracket  // }
	OpenSquareBracket  // [
	CloseSquareBracket // ]
)

func (TokenType) New

func (t TokenType) New() Token

func (TokenType) String

func (t TokenType) String() string

func (TokenType) WithLiteral

func (t TokenType) WithLiteral(literal string) Token

Jump to

Keyboard shortcuts

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