(pos Pos)
| 173 | } |
| 174 | |
| 175 | func (p *Parser) parseSystemDropExpr(pos Pos) (*SystemDropExpr, error) { |
| 176 | if err := p.expectKeyword(KeywordDrop); err != nil { |
| 177 | return nil, err |
| 178 | } |
| 179 | switch { |
| 180 | case p.matchKeyword(KeywordDNS), |
| 181 | p.matchKeyword(KeywordMark), |
| 182 | p.matchKeyword(KeywordUncompressed), |
| 183 | p.matchKeyword(KeywordFileSystem), |
| 184 | p.matchKeyword(KeywordQuery): |
| 185 | prefixToken := p.last() |
| 186 | _ = p.lexer.consumeToken() |
| 187 | lastToken := p.last() |
| 188 | if err := p.expectKeyword(KeywordCache); err != nil { |
| 189 | return nil, err |
| 190 | } |
| 191 | return &SystemDropExpr{ |
| 192 | DropPos: pos, |
| 193 | StatementEnd: lastToken.End, |
| 194 | Type: prefixToken.String + " CACHE", |
| 195 | }, nil |
| 196 | case p.matchKeyword(KeywordCompiled): |
| 197 | _ = p.lexer.consumeToken() |
| 198 | if err := p.expectKeyword(KeywordExpression); err != nil { |
| 199 | return nil, err |
| 200 | } |
| 201 | lastToken := p.last() |
| 202 | if err := p.expectKeyword(KeywordCache); err != nil { |
| 203 | return nil, err |
| 204 | } |
| 205 | return &SystemDropExpr{ |
| 206 | DropPos: pos, |
| 207 | StatementEnd: lastToken.End, |
| 208 | Type: "COMPILED EXPRESSION CACHE", |
| 209 | }, nil |
| 210 | default: |
| 211 | return nil, fmt.Errorf("expected DNS|MARK|REPLICA|DATABASE|UNCOMPRESSION|COMPILED|QUERY") |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | func (p *Parser) tryParseDeduplicateClause(pos Pos) (*DeduplicateClause, error) { |
| 216 | if !p.matchKeyword(KeywordDeduplicate) { |
no test coverage detected