token

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2015 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package token defines constants representing the lexical tokens of the Go programming language and basic operations on tokens (printing, predicates).

Index

Constants

This section is empty.

Variables

View Source
var Tokens = [...]string{
	ItemEOF:   "eof",
	ItemError: "error",
	IF:        "@if",
	ELSE:      "@else",
	EACH:      "@each",
	IMPORT:    "@import",
	INCLUDE:   "@include",
	INTP:      "#{",
	FUNC:      "@function",
	MIXIN:     "@mixin",
	EXTRA:     "extra",
	CMD:       "command",
	VAR:       "variable",
	CMDVAR:    "command-variable",
	SUB:       "sub",
	VALUE:     "value",
	FILE:      "file",
	SPRITE:    "sprite",
	SPRITEF:   "sprite-file",
	SPRITED:   "sprite-dimensions",
	SPRITEH:   "sprite-height",
	SPRITEW:   "sprite-width",
	NUMBER:    "number",
	TEXT:      "text",
	DOLLAR:    "$",
	PLUS:      "+",
	MINUS:     "-",
	MULT:      "*",
	DIVIDE:    "/",
	LPAREN:    "(",
	RPAREN:    ")",
	LBRACKET:  "{",
	RBRACKET:  "}",
	SEMIC:     ";",
	COLON:     ":",
	CMT:       "comment",
	BKND:      "background",
	FIN:       "FINISHED",
}

Functions

This section is empty.

Types

type ItemType

type ItemType int

A type for all the types of items in the language being lexed. These only parser SASS specific language elements and not CSS.

const (
	NotFound          = -1
	ItemEOF  ItemType = iota
	ItemError
	IF
	ELSE
	EACH
	IMPORT
	INCLUDE
	INTP
	FUNC
	MIXIN
	EXTRA
	CMD
	VAR
	CMDVAR
	SUB
	VALUE
	FILE

	SPRITE
	SPRITEF
	SPRITED
	SPRITEH
	SPRITEW

	NUMBER
	TEXT
	DOLLAR

	PLUS
	MINUS
	MULT
	DIVIDE

	LPAREN
	RPAREN
	LBRACKET
	RBRACKET
	SEMIC
	COLON
	CMT

	BKND

	FIN
)

Special item types.

func Lookup

func Lookup(ident string) ItemType

Lookup ItemType by token string

func (ItemType) String

func (i ItemType) String() string

type Token

type Token int

Token is the set of lexical tokens of the Go programming language. Token is not currently used, but should be added to ItemType as CSS parsing is needed

const (
	EM Token
	EX
	PX
	CM
	MM
	PT
	PC
	DEG
	RAD
	GRAD
	MS
	S
	HZ
	KHZ

	OPERA
	WEBKIT
	MOZ
	VENDORMS
	KHTML

	CHARSET
	MEDIA
	KEYFRAMES
	ONLY
	RGB
	URL
	IMAGEURL
	IMPORTANT
	NOT
	EVEN
	ODD
	PROGID
	EXPRESSION
	CALC
	MOZCALC
	WEBKITCALC
)

The list of tokens.

Jump to

Keyboard shortcuts

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