Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer tokenizes gsh script source code
type TokenType ¶
type TokenType int
TokenType represents the type of a token
const ( // Special tokens ILLEGAL TokenType = iota EOF COMMENT // Identifiers and literals IDENT // variable names, function names NUMBER // 123, 45.67 STRING // "hello", 'world', """multiline""" TEMPLATE_LITERAL // `template ${expr}` // Keywords KW_MCP KW_MODEL KW_AGENT KW_ACP KW_TOOL KW_IF KW_ELSE KW_FOR KW_OF KW_WHILE KW_BREAK KW_CONTINUE KW_TRY KW_CATCH KW_FINALLY KW_RETURN KW_THROW KW_IMPORT KW_EXPORT KW_FROM KW_GO // Reserved for future concurrency support (fire-and-forget) // Operators OP_ASSIGN // = OP_PLUS // + OP_MINUS // - OP_ASTERISK // * OP_SLASH // / OP_PERCENT // % OP_BANG // ! OP_EQ // == OP_NEQ // != OP_LT // < OP_GT // > OP_LTE // <= OP_GTE // >= OP_AND // && OP_OR // || OP_PIPE // | OP_QUESTION // ? OP_NULLCOAL // ?? // Delimiters COMMA // , COLON // : SEMICOLON // ; DOT // . LPAREN // ( RPAREN // ) LBRACE // { RBRACE // } LBRACKET // [ RBRACKET // ] )
func LookupIdent ¶
LookupIdent checks if an identifier is a keyword and returns the appropriate token type
Click to show internal directories.
Click to hide internal directories.