Documentation
¶
Index ¶
- func Dialect() core.Option
- func NewCatalog() *catalog.Catalog
- func NewIdentifier(id *meyer.Ident) *ast.String
- type Parser
- func (p *Parser) Cast(arg, typeName string) string
- func (p *Parser) CommentSyntax() source.CommentSyntax
- func (p *Parser) IsReservedKeyword(s string) bool
- func (p *Parser) Param(n int, numbered bool) string
- func (p *Parser) Parse(r io.Reader) ([]ast.Statement, error)
- func (p *Parser) ParseFile(r io.Reader) (*ast.File, error)
- func (p *Parser) QuoteIdent(s string) string
- func (p *Parser) TypeName(ns, name string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCatalog ¶
Types ¶
type Parser ¶
type Parser struct {
}
func (*Parser) CommentSyntax ¶
func (p *Parser) CommentSyntax() source.CommentSyntax
func (*Parser) IsReservedKeyword ¶
IsReservedKeyword reports whether s is a keyword in SQLite; see https://sqlite.org/lang_keywords.html. The table lives in meyer, which transcribes it from SQLite's own aKeywordTable.
func (*Parser) Param ¶
Param returns the parameter placeholder for the given number. SQLite takes both a bare ? (the next index) and an explicit ?N, and they are not interchangeable — reordered ?N parameters bind by their numbers — so the one the author wrote is the one printed.
func (*Parser) ParseFile ¶
ParseFile parses like Parse and also carries the file's comments, taken from the trivia meyer's single lexer pass produces alongside the tokens.
func (*Parser) QuoteIdent ¶
QuoteIdent quotes an identifier when printing it bare would change what it names: the parser folds unquoted identifiers to lower case, so any name that is not already a plain lower-case identifier — or that collides with a keyword — only survives a parse round-trip inside double quotes.