MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / isStatementStartingKeyword

Method isStatementStartingKeyword

pkg/sql/parser/recovery.go:83–97  ·  view source on GitHub ↗

isStatementStartingKeyword checks if the current token is a statement-starting keyword.

()

Source from the content-addressed store, hash-verified

81
82// isStatementStartingKeyword checks if the current token is a statement-starting keyword.
83func (p *Parser) isStatementStartingKeyword() bool {
84 if p.currentToken.Token.Type != models.TokenTypeUnknown {
85 switch p.currentToken.Token.Type {
86 case models.TokenTypeSelect, models.TokenTypeInsert, models.TokenTypeUpdate,
87 models.TokenTypeDelete, models.TokenTypeCreate, models.TokenTypeAlter,
88 models.TokenTypeDrop, models.TokenTypeWith, models.TokenTypeMerge,
89 models.TokenTypeRefresh, models.TokenTypeTruncate,
90 models.TokenTypeGrant, models.TokenTypeRevoke,
91 models.TokenTypeSet, models.TokenTypeBegin,
92 models.TokenTypeCommit, models.TokenTypeRollback:
93 return true
94 }
95 }
96 return false
97}
98
99// synchronize advances the parser past the current error to a synchronization point:
100// either past a semicolon or to a statement-starting keyword.

Callers 1

synchronizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected