token

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LookupKeywork  = newLooker()
	LookupOperator = newLooker()
)

Functions

This section is empty.

Types

type Token

type Token uint
const (
	INVALID Token = iota
	COMMENT
	EOF

	NIL    // nil
	BOOL   // true or false
	STRING // "123" or '123' or `123`
	NUMBER // 123 or 123.4
	IDENT  // abc or a123

	ADD // +
	SUB // -
	MUL // *
	QUO // /
	POW // **
	REM // %

	AND     // &
	OR      // |
	XOR     // ^
	SHL     // <<
	SHR     // >>
	AND_NOT // &^

	ADD_ASSIGN // +=
	SUB_ASSIGN // -=
	MUL_ASSIGN // *=
	QUO_ASSIGN // /=
	POW_ASSIGN // **=
	REM_ASSIGN // %=

	AND_ASSIGN     // &=
	OR_ASSIGN      // |=
	XOR_ASSIGN     // ^=
	SHL_ASSIGN     // <<=
	SHR_ASSIGN     // >>=
	AND_NOT_ASSIGN // &^=

	LAND  // &&
	LOR   // ||
	ARROW // <-
	INC   // ++
	DEC   // --

	EQL    // ==
	LSS    // <
	GTR    // >
	ASSIGN // =
	NOT    // !

	NEQ      // !=
	LEQ      // <=
	GEQ      // >=
	DEFINE   // :=
	ELLIPSIS // ...

	LPAREN // (
	LBRACK // [
	LBRACE // {
	COMMA  // ,
	PERIOD // .

	RPAREN    // )
	RBRACK    // ]
	RBRACE    // }
	SEMICOLON // ;
	COLON     // :

	MAP    // map
	IF     // if
	ELSE   // else
	FOR    // for
	FUNC   // func
	RETURN // return

)

func (Token) IsKeywork

func (t Token) IsKeywork() bool

func (Token) IsLiteral

func (t Token) IsLiteral() bool

func (Token) IsOperator

func (t Token) IsOperator() bool

func (Token) Precedence

func (op Token) Precedence() int

func (Token) String

func (op Token) String() string

Jump to

Keyboard shortcuts

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