{"modulePath":"github.com/viant/sqlparser","version":"v0.13.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package source\n\nPackage source provides source-preserving SQL lexical operations. It owns protected regions and nesting; consumers retain their own macro semantics.\n\n## Functions\n\n```go\nfunc CriteriaBoundary(source string) int\n```\n\n```go\nfunc DollarQuoteDelimiterSize[T ~string | ~[]byte](text T) int\n```\nDollarQuoteDelimiterSize returns the size of an opening $$ or $tag$ delimiter, or zero for ordinary placeholders such as $name and $1.\n\n```go\nfunc FindCodeToken(source, token string, start int) int\n```\n\n```go\nfunc FindLastTopLevelKeyword(source, keyword string, start int) int\n```\n\n```go\nfunc FindTopLevelKeyword(source, keyword string, start int) int\n```\n\n```go\nfunc HasTopLevelClause(source, clause string) bool\n```\n\n```go\nfunc IsWhitespace(value byte) bool\n```\n\n```go\nfunc MaskLineComments(text string) string\n```\nMaskLineComments preserves byte offsets and newlines while removing only executable SQL line comments. Quoted '--' remains literal content.\n\n```go\nfunc ProtectedRangeAt(source string, position int) (int, int, string)\n```\nProtectedRangeAt returns the half-open quoted/comment span containing an offset. An empty kind means the offset is executable code or out of range.\n\n```go\nfunc ProtectionAt(source string, position int) string\n```\n\n```go\nfunc ReadGroupString(source string, start int, open, close byte) (string, int, bool)\n```\nReadGroupString returns the delimited source and its exclusive end offset.\n\n```go\nfunc SplitArgs(source string) []string\n```\n\n```go\nfunc SplitTopLevelAlias(source string) (string, string)\n```\n\n```go\nfunc SplitTopLevelCSV(source string) []string\n```\n\n```go\nfunc TrimQuote(source string) string\n```\n\n```go\nfunc TrimQuotedArgs(args []string) []string\n```\n\n```go\nfunc ValidateStructure(text string) error\n```\nValidateStructure checks parentheses, subscripts and protected-region closure without imposing a dialect grammar on executable expressions or template semantics.\n\n## Types\n\n```go\ntype CodeScanner struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewCodeScanner(source string, start int) *CodeScanner\n```\n\n```go\nfunc (s *CodeScanner) Next() (int, bool)\n```\n\n```go\nfunc (s *CodeScanner) PreviousSignificant() (position int, kind string)\n```\nPreviousSignificant returns the last non-whitespace, non-comment byte before the byte just returned by a successful Next. Call it before advancing again. Quoted text is significant and has a nonempty kind; -1 means no preceding text. A lazy cursor reuses the protected-region lexer and advances through preceding SQL once across lookups, for O(n) total time and O(1) space.\n\n```go\ntype Token string\n```\n\n```go\nfunc (t Token) Contains(source string) bool\n```\n\n```go\nfunc (t Token) Find(source string, start int) int\n```\n\n```go\nfunc (t Token) ReplaceAll(source, replacement string) string\n```\n\n","path":"github.com/viant/sqlparser/source","name":"source","synopsis":"Package source provides source-preserving SQL lexical operations.","isRedistributable":true}
