token

package
v0.50.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 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 File

type File struct {
	// contains filtered or unexported fields
}

func NewFile added in v0.9.0

func NewFile(name string, sz int) *File

func (*File) AddLine

func (f *File) AddLine(offset int)

func (*File) Base

func (f *File) Base() int

func (*File) Name added in v0.7.2

func (f *File) Name() string

func (*File) Offset added in v0.9.0

func (f *File) Offset(pos ast.Position) int

Offset returns the offset for the given line/column.

func (*File) Pos

func (f *File) Pos(offset int) Pos

func (*File) Position

func (f *File) Position(pos Pos) ast.Position

func (*File) Size added in v0.7.2

func (f *File) Size() int

type FileSet

type FileSet struct {
	// contains filtered or unexported fields
}

func (*FileSet) AddFile

func (f *FileSet) AddFile(filename string, size int) *File

type Pos

type Pos int

type Token

type Token int
const (
	ILLEGAL Token = iota
	EOF
	COMMENT

	// Reserved keywords.
	AND
	OR
	NOT
	EMPTY
	IN
	IMPORT
	PACKAGE
	RETURN
	OPTION
	BUILTIN
	TEST
	IF
	THEN
	ELSE
	WITH

	// Identifiers and literals.
	IDENT
	INT
	FLOAT
	STRING
	REGEX
	TIME
	DURATION

	// Operators.
	ADD
	SUB
	MUL
	DIV
	MOD
	POW
	EQ
	LT
	GT
	LTE
	GTE
	NEQ
	REGEXEQ
	REGEXNEQ
	ASSIGN
	ARROW
	LPAREN
	RPAREN
	LBRACK
	RBRACK
	LBRACE
	RBRACE
	COMMA
	DOT
	COLON
	PIPE_FORWARD
	PIPE_RECEIVE
	EXISTS

	// String expression tokens.
	QUOTE
	STRINGEXPR
	TEXT
)

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