Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Keywords = []TokenKind{
"ALL",
"AND",
"ANY",
"ARRAY",
"AS",
"ASC",
"ASSERT_ROWS_MODIFIED",
"AT",
"BETWEEN",
"BY",
"CASE",
"CAST",
"COLLATE",
"CONTAINS",
"CREATE",
"CROSS",
"CUBE",
"CURRENT",
"DEFAULT",
"DEFINE",
"DESC",
"DISTINCT",
"ELSE",
"END",
"ENUM",
"ESCAPE",
"EXCEPT",
"EXCLUDE",
"EXISTS",
"EXTRACT",
"FALSE",
"FETCH",
"FOLLOWING",
"FOR",
"FROM",
"FULL",
"GRAPH_TABLE",
"GROUP",
"GROUPING",
"GROUPS",
"HASH",
"HAVING",
"IGNORE",
"IF",
"IN",
"INNER",
"INTERSECT",
"INTERVAL",
"INTO",
"IS",
"JOIN",
"LATERAL",
"LEFT",
"LIKE",
"LIMIT",
"LOOKUP",
"MERGE",
"NATURAL",
"NEW",
"NO",
"NOT",
"NULL",
"NULLS",
"OF",
"ON",
"OR",
"ORDER",
"OUTER",
"OVER",
"PARTITION",
"PRECEDING",
"PROTO",
"RANGE",
"RECURSIVE",
"RESPECT",
"RIGHT",
"ROLLUP",
"ROWS",
"SELECT",
"SET",
"SOME",
"STRUCT",
"TABLESAMPLE",
"THEN",
"TO",
"TREAT",
"TRUE",
"UNBOUNDED",
"UNION",
"UNNEST",
"USING",
"WHEN",
"WHERE",
"WINDOW",
"WITH",
"WITHIN",
}
View Source
var KeywordsMap map[TokenKind]struct{}
Functions ¶
func QuoteSQLBytes ¶
QuoteSQLBytes returns quoted string with SQL bytes escaping.
func QuoteSQLIdent ¶
QuoteSQLIdent returns quoted identifier if needed, otherwise it returns the input string.
func QuoteSQLString ¶
QuoteSQLString returns quoted string with SQL string escaping.
Types ¶
type File ¶
File is input file with source code.
type Pos ¶
type Pos int
Pos is just source code position.
Internally it is zero-origin offset of the buffer.
const InvalidPos Pos = -1
type Position ¶
type Position struct { FilePath string Pos, End Pos // Line and Column are 0-origin. Line, Column int EndLine, EndColumn int // Source is source code around this position with line number and cursor // for detailed error message. Source string }
Position is source code position with file path and source code around this position.
type Token ¶
type Token struct { Kind TokenKind Comments []TokenComment Space string Raw string AsString string // available for TokenIdent, TokenString and TokenBytes Base int // 10 or 16 on TokenInt Pos, End Pos }
func (*Token) IsKeywordLike ¶
type TokenComment ¶
Click to show internal directories.
Click to hide internal directories.