token

package
v6.0.0-...-03bcada Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2017 License: MIT Imports: 0 Imported by: 9

Documentation

Index

Constants

View Source
const (
	EOF = iota // 0
	ILLEGAL

	// Identifiers + literals
	LBRACE // {
	RBRACE // }
	//	PARAM_IDENTIFIER // id
	COLON // :
	// let's take them in parser
	//	PARAM_TYPE       // int, string, alphabetical, file, path or unexpected
	//	PARAM_FUNC       // range
	LPAREN // (
	RPAREN // )
	//	PARAM_FUNC_ARG   // 1
	COMMA
	IDENT // string or keyword

	ELSE // else

	INT // 42

)

/about/{fullname:alphabetical} /profile/{anySpecialName:string} {id:int range(1,5) else 404} /admin/{id:int eq(1) else 402} /file/{filepath:file else 405}

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    TokenType
	Literal string
	Start   int // including the first char, Literal[index:]
	End     int // including the last char, Literal[start:end+1)
}

type TokenType

type TokenType int

func LookupIdent

func LookupIdent(ident string) TokenType

Jump to

Keyboard shortcuts

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