Documentation ¶
Index ¶
Constants ¶
View Source
const ( TOKEN_DEF uint8 = iota TOKEN_CLASS TOKEN_END TOKEN_IF TOKEN_ELSE TOKEN_ELSIF TOKEN_BEGIN TOKEN_DO TOKEN_CONTINUE TOKEN_FOR TOKEN_WHILE TOKEN_LAMBDA TOKEN_RETURN TOKEN_BREAK TOKEN_NEXT TOKEN_RESCUE TOKEN_TRUE TOKEN_FALSE TOKEN_NIL TOKEN_SUPER TOKEN_UNLESS TOKEN_REQUIRE TOKEN_REQUIRE_RELATIVE TOKEN_YIELD TOKEN_RAISE // /n TOKEN_NEWLINE // + - * / TOKEN_PLUS TOKEN_MINUS // MINUS immediately followed by token // we introduce this token mainly to distinguish // between "puts foo - bar" and "puts foo -bar" // we parse the former as "puts( (foo) - (bar) )" // latter as "puts(foo(-bar))" TOKEN_NEGATE_MINUS TOKEN_SLASH TOKEN_STAR // ( ) TOKEN_LEFT_PAREN TOKEN_RIGHT_PAREN // { } TOKEN_LEFT_BRACE TOKEN_RIGHT_BRACE // . TOKEN_DOT // | || TOKEN_BAR TOKEN_OR // & && &. TOKEN_AND TOKEN_LOGIC_AND TOKEN_OPTIONAL_CALL // < > = ! != <= >= == TOKEN_LESS TOKEN_GREATER TOKEN_EQUAL TOKEN_BANG TOKEN_BANG_EQUAL TOKEN_EQUAL_EQUAL TOKEN_GREATER_EQUAL TOKEN_LESS_EQUAL // ? TOKEN_QUESTION_MARK // [ ] TOKEN_LEFT_BRACKET TOKEN_RIGHT_BRACKET // : :: :foo TOKEN_COLON TOKEN_DOUBLE_COLON TOKEN_SYMBOL // , TOKEN_COMMA // => TOKEN_ARROW // Literals TOKEN_STRING TOKEN_DOUBLE TOKEN_INT TOKEN_IDENTIFIER TOKEN_IDENTIFIER_GLOBAL TOKEN_IDENTIFIER_IVAR TOKEN_IDENTIFIER_CVAR TOKEN_STRING_LIST // Interpolation TOKEN_DOUBLE_QUOTE // " TOKEN_INTERPO_EXP_START // #{ TOKEN_EOF )
Variables ¶
View Source
var EOF = Token{Type: TOKEN_EOF}
Functions ¶
func PrintToken ¶
func PrintToken(token Token)
Types ¶
Click to show internal directories.
Click to hide internal directories.