mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
pdo_pgsql: add support for dollar-quotes
RFC: http://wiki.php.net/rfc/pdo_driver_specific_parsers
This commit is contained in:
parent
e82c486918
commit
01879ec254
4 changed files with 67 additions and 9 deletions
|
@ -29,8 +29,10 @@ int pdo_pgsql_scanner(pdo_scanner_t *s)
|
|||
BINDCHR = [:][a-zA-Z0-9_]+;
|
||||
QUESTION = [?];
|
||||
ESCQUESTION = [?][?];
|
||||
COMMENTS = ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--"[^\r\n]*);
|
||||
SPECIALS = [eE:?"'/-];
|
||||
COMMENTS = ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--".*);
|
||||
DOLQ_START = [A-Za-z\200-\377_];
|
||||
DOLQ_CONT = [A-Za-z\200-\377_0-9];
|
||||
SPECIALS = [$eE:?"'/-];
|
||||
MULTICHAR = [:]{2,};
|
||||
ANYNOEOF = [\001-\377];
|
||||
*/
|
||||
|
@ -39,6 +41,7 @@ int pdo_pgsql_scanner(pdo_scanner_t *s)
|
|||
[eE](['](([']['])|([\\]ANYNOEOF)|ANYNOEOF\['\\])*[']) { RET(PDO_PARSER_TEXT); }
|
||||
(["]((["]["])|ANYNOEOF\["])*["]) { RET(PDO_PARSER_TEXT); }
|
||||
(['](([']['])|ANYNOEOF\['])*[']) { RET(PDO_PARSER_TEXT); }
|
||||
[$](DOLQ_START DOLQ_CONT*)?[$] { RET(PDO_PARSER_CUSTOM_QUOTE); }
|
||||
MULTICHAR { RET(PDO_PARSER_TEXT); }
|
||||
ESCQUESTION { RET(PDO_PARSER_ESCAPED_QUESTION); }
|
||||
BINDCHR { RET(PDO_PARSER_BIND); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue