mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
Applied Peter's patch to use yyless instead of my string_unput function.
This commit is contained in:
@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.118 2003/06/26 11:37:05 meskes Exp $
|
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.119 2003/07/25 05:42:27 meskes Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -42,7 +42,6 @@ static int literalalloc; /* current allocated buffer size */
|
|||||||
#define startlit() (literalbuf[0] = '\0', literallen = 0)
|
#define startlit() (literalbuf[0] = '\0', literallen = 0)
|
||||||
static void addlit(char *ytext, int yleng);
|
static void addlit(char *ytext, int yleng);
|
||||||
static void addlitchar (unsigned char);
|
static void addlitchar (unsigned char);
|
||||||
static void string_unput (char *);
|
|
||||||
static void parse_include (void);
|
static void parse_include (void);
|
||||||
|
|
||||||
char *token_start;
|
char *token_start;
|
||||||
@ -721,9 +720,7 @@ cppline {space}*#(.*\\{space})+.*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_unput("define ");
|
yyless(1);
|
||||||
/* remove the "define " part of the text */
|
|
||||||
yytext[1] = '\0';
|
|
||||||
return (S_ANYTHING);
|
return (S_ANYTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -736,9 +733,7 @@ cppline {space}*#(.*\\{space})+.*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_unput("include ");
|
yyless(1);
|
||||||
/* remove the "include " part of the text */
|
|
||||||
yytext[1] = '\0';
|
|
||||||
return (S_ANYTHING);
|
return (S_ANYTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -752,9 +747,7 @@ cppline {space}*#(.*\\{space})+.*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_unput("ifdef ");
|
yyless(1);
|
||||||
/* remove the "ifdef " part of the text */
|
|
||||||
yytext[1] = '\0';
|
|
||||||
return (S_ANYTHING);
|
return (S_ANYTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -768,9 +761,7 @@ cppline {space}*#(.*\\{space})+.*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_unput("ifndef ");
|
yyless(1);
|
||||||
/* remove the "ifndef " part of the text */
|
|
||||||
yytext[1] = '\0';
|
|
||||||
return (S_ANYTHING);
|
return (S_ANYTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -801,9 +792,7 @@ cppline {space}*#(.*\\{space})+.*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_unput("elif ");
|
yyless(1);
|
||||||
/* remove the "elif " part of the text */
|
|
||||||
yytext[1] = '\0';
|
|
||||||
return (S_ANYTHING);
|
return (S_ANYTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -845,9 +834,7 @@ cppline {space}*#(.*\\{space})+.*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_unput("else ");
|
yyless(1);
|
||||||
/* remove the "else " part of the text */
|
|
||||||
yytext[1] = '\0';
|
|
||||||
return (S_ANYTHING);
|
return (S_ANYTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -878,9 +865,7 @@ cppline {space}*#(.*\\{space})+.*
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_unput("endif ");
|
yyless(1);
|
||||||
/* remove the "endif " part of the text */
|
|
||||||
yytext[1] = '\0';
|
|
||||||
return (S_ANYTHING);
|
return (S_ANYTHING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1045,16 +1030,6 @@ addlitchar(unsigned char ychar)
|
|||||||
literalbuf[literallen] = '\0';
|
literalbuf[literallen] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put string back on stack */
|
|
||||||
static void
|
|
||||||
string_unput (char *string)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = strlen(string)-1; i>=0; i--)
|
|
||||||
unput(string[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_include(void)
|
parse_include(void)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user