Commit Graph

6 Commits

Author SHA1 Message Date
6eb2909901 [parser] change all dot import, according to staticcheck (#730)
* change all dot import, according to staticcheck

* make staticcheck happy
2021-10-09 14:53:23 +08:00
5cfb690491 [parser] Rewrite special comment parser (#711)
* lexer: added a function to scan version digits

* lexer: removed special comment scanner

Instead, simply strip off '/*!' and the pairing '*/'.

Temporarily disabled handling of /*+ ... */

* lexer: support collecting the entire /*+ ... */ as a single token

This new token has type `hintComment`. The actual hint will be parsed
lazily.

* lexer,yy_parser: move lastErrorAsWarn() from Parser into Scanner

* goyacc: do not allow conflict, support changing parser type name

change the "DO NOT EDIT" line to fit the Go standard

* parser,hintparser: created a new parser just for parsing optimizer hints

deleted all optimizer hint rules from parser.go

refactor the Makefile to support building both parsers (also deleted some
outdated fixup of *parser.go)

* lexer: fix comment parser

* codecov: don't wait for integration test before showing the coverage

* lexer: fix comment parsing again

* hintparser: TiDB still expects `HASH_JOIN(@qb1 foo@qb2)` to be valid :(

* parser,hintparser: provide the true line/column offset in the warnings

cache the hintparser in the main parser to avoid repeated allocation

* lexer: delete unused sqlOffsetInComment()
2021-10-09 14:53:23 +08:00
a7ac29bd99 [parser] parser: introduce DigestNormalized and deprecate DigestHash (#656) 2021-10-09 14:53:23 +08:00
824bc91f46 [parser] digester: avoid infinite loop when an invalid token is seen (#313) 2021-10-09 14:53:23 +08:00
f6cb990bb0 [parser] normalize and generate digest at same time (#215) 2021-10-09 14:53:23 +08:00
fee9359019 [parser] support sql digest (#32) 2021-10-09 14:53:23 +08:00