token

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pos

type Pos int

Pos is the internal representation of a position within a source file.

type Position

type Position struct {
	Offset int // byte offset, starting at 0
	Line   int // line number, starting at 1
	Column int // column number, starting at 1 (in bytes)
}

Position describes a position within a source file including the line and column location. A Position is valid if the line number is > 0.

type Token

type Token int

Token is the set of lexical tokens.

const (
	ILLEGAL Token = iota
	EOF
	LIT
	LITWORD

	// Rest of tokens
	SQUOTE // '
	DQUOTE // "
	BQUOTE // `

	AND  // &
	LAND // &&
	OR   // |
	LOR  // ||

	ASSIGN // =
	DOLLAR // $
	DOLLSQ // $'
	DOLLDQ // $"
	DOLLBR // ${
	DOLLBK // $[
	DOLLPR // $(
	DOLLDP // $((
	DLBRCK // [[
	LET    // let
	LBRACE // {
	LPAREN // (

	RBRACE     // }
	RBRACK     // ]
	RPAREN     // )
	DRBRCK     // ]]
	SEMICOLON  // ;
	DSEMICOLON // ;;
	SEMIFALL   // ;&
	DSEMIFALL  // ;;&
	COLON      // :

	LSS // <
	GTR // >
	SHL // <<
	SHR // >>

	ADD   // +
	SUB   // -
	REM   // %
	MUL   // *
	QUO   // /
	XOR   // ^
	NOT   // !
	INC   // ++
	DEC   // --
	POW   // **
	COMMA // ,
	EQL   // ==
	NEQ   // !=
	LEQ   // <=
	GEQ   // >=

	ADDASSGN // +=
	SUBASSGN // -=
	MULASSGN // *=
	QUOASSGN // /=
	REMASSGN // %=
	ANDASSGN // &=
	ORASSGN  // |=
	XORASSGN // ^=
	SHLASSGN // <<=
	SHRASSGN // >>=

	PIPEALL  // |&
	RDRINOUT // <>
	DPLIN    // <&
	DPLOUT   // >&
	CLBOUT   // >|
	DHEREDOC // <<-
	WHEREDOC // <<<
	CMDIN    // <(
	CMDOUT   // >(
	RDRALL   // &>
	APPALL   // &>>

	CADD    // :+
	CSUB    // :-
	QUEST   // ?
	CQUEST  // :?
	CASSIGN // :=
	DREM    // %%
	HASH    // #
	DHASH   // ##
	LBRACK  // [
	DQUO    // //
	DXOR    // ^^
	DCOMMA  // ,,

	DLPAREN // ((
	DRPAREN // ))

	TEXISTS  // -e
	TREGFILE // -f
	TDIRECT  // -d
	TCHARSP  // -c
	TBLCKSP  // -b
	TNMPIPE  // -p
	TSOCKET  // -S
	TSMBLINK // -L
	TSGIDSET // -g
	TSUIDSET // -u
	TREAD    // -r
	TWRITE   // -w
	TEXEC    // -x
	TNOEMPTY // -s
	TFDTERM  // -t
	TEMPSTR  // -z
	TNEMPSTR // -n
	TOPTSET  // -o
	TVARSET  // -v
	TNRFVAR  // -R

	TREMATCH // =~
	TNEWER   // -nt
	TOLDER   // -ot
	TDEVIND  // -ef
	TEQL     // -eq
	TNEQ     // -ne
	TLEQ     // -le
	TGEQ     // -ge
	TLSS     // -lt
	TGTR     // -gt

	GQUEST // ?(
	GMUL   // *(
	GADD   // +(
	GAT    // @(
	GNOT   // !(
)

The list of all possible tokens and reserved words.

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