Commit Graph

11 Commits

Author SHA1 Message Date
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
ba3ed9535b [parser] add yacc file formatter (#701) 2021-10-09 14:53:23 +08:00
e57636c295 [parser] Remove abandon command in Makefile (#703) 2021-10-09 14:53:23 +08:00
9b4d96cd61 [parser] add copy go.mod1 to go.mod in Makefile (#588) 2021-10-09 14:53:23 +08:00
1c514a63ca [parser] parser: fix alter_stmt order by syntax (#526) 2021-10-09 14:53:23 +08:00
cf41e85103 [parser] makefile: add fmt command in Makefile (#121) 2021-10-09 14:53:23 +08:00
ee29b5f005 [parser] update README.md, fix make test, add circle.yml (#23) 2021-10-09 14:53:23 +08:00
a1f4f3efa3 [parser] Makefile: fix 'make test' (#15) 2021-10-09 14:53:23 +08:00
2095376b3b [parser] goyacc: fix unstability of generated parser.go (#9) 2021-10-09 14:53:23 +08:00
698cefe6bd [parser] address comment 2021-10-09 14:53:23 +08:00
c270f55405 [parser] *: move github.com/pingcap/tidb/parser here (#1) 2021-10-09 14:53:23 +08:00