mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
update the .re file for PDO
This commit is contained in:
parent
7d663aa90c
commit
598c935245
2 changed files with 33 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
||||||
/* Generated by re2c 0.13.5 */
|
/* Generated by re2c 0.13.7.5 */
|
||||||
|
#line 1 "ext/pdo/pdo_sql_parser.re"
|
||||||
/*
|
/*
|
||||||
+----------------------------------------------------------------------+
|
+----------------------------------------------------------------------+
|
||||||
| PHP Version 7 |
|
| PHP Version 7 |
|
||||||
|
@ -46,9 +47,11 @@ static int scan(Scanner *s)
|
||||||
char *cursor = s->cur;
|
char *cursor = s->cur;
|
||||||
|
|
||||||
s->tok = cursor;
|
s->tok = cursor;
|
||||||
|
#line 55 "ext/pdo/pdo_sql_parser.re"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#line 55 "ext/pdo/pdo_sql_parser.c"
|
||||||
{
|
{
|
||||||
YYCTYPE yych;
|
YYCTYPE yych;
|
||||||
unsigned int yyaccept = 0;
|
unsigned int yyaccept = 0;
|
||||||
|
@ -67,16 +70,19 @@ static int scan(Scanner *s)
|
||||||
}
|
}
|
||||||
yy2:
|
yy2:
|
||||||
YYCURSOR = YYMARKER;
|
YYCURSOR = YYMARKER;
|
||||||
switch (yyaccept) {
|
if (yyaccept == 0) {
|
||||||
case 0: goto yy4;
|
goto yy4;
|
||||||
case 1: goto yy10;
|
} else {
|
||||||
|
goto yy10;
|
||||||
}
|
}
|
||||||
yy3:
|
yy3:
|
||||||
yyaccept = 0;
|
yyaccept = 0;
|
||||||
yych = *(YYMARKER = ++YYCURSOR);
|
yych = *(YYMARKER = ++YYCURSOR);
|
||||||
if (yych >= 0x01) goto yy43;
|
if (yych >= 0x01) goto yy43;
|
||||||
yy4:
|
yy4:
|
||||||
|
#line 63 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ SKIP_ONE(PDO_PARSER_TEXT); }
|
{ SKIP_ONE(PDO_PARSER_TEXT); }
|
||||||
|
#line 86 "ext/pdo/pdo_sql_parser.c"
|
||||||
yy5:
|
yy5:
|
||||||
yyaccept = 0;
|
yyaccept = 0;
|
||||||
yych = *(YYMARKER = ++YYCURSOR);
|
yych = *(YYMARKER = ++YYCURSOR);
|
||||||
|
@ -158,7 +164,9 @@ yy7:
|
||||||
default: goto yy8;
|
default: goto yy8;
|
||||||
}
|
}
|
||||||
yy8:
|
yy8:
|
||||||
|
#line 62 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ RET(PDO_PARSER_BIND_POS); }
|
{ RET(PDO_PARSER_BIND_POS); }
|
||||||
|
#line 170 "ext/pdo/pdo_sql_parser.c"
|
||||||
yy9:
|
yy9:
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
switch ((yych = *YYCURSOR)) {
|
switch ((yych = *YYCURSOR)) {
|
||||||
|
@ -166,7 +174,9 @@ yy9:
|
||||||
default: goto yy13;
|
default: goto yy13;
|
||||||
}
|
}
|
||||||
yy10:
|
yy10:
|
||||||
|
#line 65 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ RET(PDO_PARSER_TEXT); }
|
{ RET(PDO_PARSER_TEXT); }
|
||||||
|
#line 180 "ext/pdo/pdo_sql_parser.c"
|
||||||
yy11:
|
yy11:
|
||||||
yych = *++YYCURSOR;
|
yych = *++YYCURSOR;
|
||||||
switch (yych) {
|
switch (yych) {
|
||||||
|
@ -201,7 +211,9 @@ yy14:
|
||||||
default: goto yy14;
|
default: goto yy14;
|
||||||
}
|
}
|
||||||
yy16:
|
yy16:
|
||||||
|
#line 64 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ RET(PDO_PARSER_TEXT); }
|
{ RET(PDO_PARSER_TEXT); }
|
||||||
|
#line 217 "ext/pdo/pdo_sql_parser.c"
|
||||||
yy17:
|
yy17:
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||||
|
@ -279,7 +291,9 @@ yy29:
|
||||||
default: goto yy31;
|
default: goto yy31;
|
||||||
}
|
}
|
||||||
yy31:
|
yy31:
|
||||||
|
#line 60 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ RET(PDO_PARSER_TEXT); }
|
{ RET(PDO_PARSER_TEXT); }
|
||||||
|
#line 297 "ext/pdo/pdo_sql_parser.c"
|
||||||
yy32:
|
yy32:
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||||
|
@ -351,7 +365,9 @@ yy32:
|
||||||
default: goto yy34;
|
default: goto yy34;
|
||||||
}
|
}
|
||||||
yy34:
|
yy34:
|
||||||
|
#line 61 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ RET(PDO_PARSER_BIND); }
|
{ RET(PDO_PARSER_BIND); }
|
||||||
|
#line 371 "ext/pdo/pdo_sql_parser.c"
|
||||||
yy35:
|
yy35:
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||||
|
@ -379,7 +395,9 @@ yy39:
|
||||||
goto yy37;
|
goto yy37;
|
||||||
yy40:
|
yy40:
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
|
#line 59 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ RET(PDO_PARSER_TEXT); }
|
{ RET(PDO_PARSER_TEXT); }
|
||||||
|
#line 401 "ext/pdo/pdo_sql_parser.c"
|
||||||
yy42:
|
yy42:
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
if (YYLIMIT <= YYCURSOR) YYFILL(1);
|
||||||
|
@ -399,17 +417,20 @@ yy44:
|
||||||
goto yy42;
|
goto yy42;
|
||||||
yy45:
|
yy45:
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
|
#line 58 "ext/pdo/pdo_sql_parser.re"
|
||||||
{ RET(PDO_PARSER_TEXT); }
|
{ RET(PDO_PARSER_TEXT); }
|
||||||
|
#line 423 "ext/pdo/pdo_sql_parser.c"
|
||||||
}
|
}
|
||||||
|
#line 66 "ext/pdo/pdo_sql_parser.re"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct placeholder {
|
struct placeholder {
|
||||||
char *pos;
|
char *pos;
|
||||||
char *quoted; /* quoted value */
|
|
||||||
size_t len;
|
size_t len;
|
||||||
int bindno;
|
int bindno;
|
||||||
size_t qlen; /* quoted length of value */
|
size_t qlen; /* quoted length of value */
|
||||||
|
char *quoted; /* quoted value */
|
||||||
int freeq;
|
int freeq;
|
||||||
struct placeholder *next;
|
struct placeholder *next;
|
||||||
};
|
};
|
||||||
|
@ -419,7 +440,7 @@ static void free_param_name(zval *el) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,
|
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,
|
||||||
char **outquery, size_t *outquery_len)
|
char **outquery, size_t *outquery_len)
|
||||||
{
|
{
|
||||||
Scanner s;
|
Scanner s;
|
||||||
char *ptr, *newbuffer;
|
char *ptr, *newbuffer;
|
||||||
|
|
|
@ -68,9 +68,9 @@ static int scan(Scanner *s)
|
||||||
|
|
||||||
struct placeholder {
|
struct placeholder {
|
||||||
char *pos;
|
char *pos;
|
||||||
int len;
|
size_t len;
|
||||||
int bindno;
|
int bindno;
|
||||||
int qlen; /* quoted length of value */
|
size_t qlen; /* quoted length of value */
|
||||||
char *quoted; /* quoted value */
|
char *quoted; /* quoted value */
|
||||||
int freeq;
|
int freeq;
|
||||||
struct placeholder *next;
|
struct placeholder *next;
|
||||||
|
@ -80,15 +80,15 @@ static void free_param_name(zval *el) {
|
||||||
efree(Z_PTR_P(el));
|
efree(Z_PTR_P(el));
|
||||||
}
|
}
|
||||||
|
|
||||||
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
|
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,
|
||||||
char **outquery, int *outquery_len)
|
char **outquery, size_t *outquery_len)
|
||||||
{
|
{
|
||||||
Scanner s;
|
Scanner s;
|
||||||
char *ptr, *newbuffer;
|
char *ptr, *newbuffer;
|
||||||
int t;
|
int t;
|
||||||
int bindno = 0;
|
int bindno = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int newbuffer_len;
|
size_t newbuffer_len;
|
||||||
HashTable *params;
|
HashTable *params;
|
||||||
struct pdo_bound_param_data *param;
|
struct pdo_bound_param_data *param;
|
||||||
int query_type = PDO_PLACEHOLDER_NONE;
|
int query_type = PDO_PLACEHOLDER_NONE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue