Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
71b9df2b
Commit
71b9df2b
authored
Feb 01, 2006
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make pgc.l source code alignment consistent.
parent
bd5d12a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
224 additions
and
220 deletions
+224
-220
src/interfaces/ecpg/preproc/pgc.l
src/interfaces/ecpg/preproc/pgc.l
+224
-220
No files found.
src/interfaces/ecpg/preproc/pgc.l
View file @
71b9df2b
...
...
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.13
7 2005/10/05 14:58:36 meskes
Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.13
8 2006/02/01 20:56:44 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -777,8 +777,8 @@ cppline {space}*#(.*\\{space})*.*{newline}
keyword = ScanCKeywordLookup(yytext);
if (keyword != NULL)
return keyword->value;
else
{
else
{
yylval.str = mm_strdup(yytext);
return IDENT;
}
...
...
@@ -886,15 +886,15 @@ cppline {space}*#(.*\\{space})*.*{newline}
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
if (
preproc_tos == 0 ) {
if (
preproc_tos == 0)
mmerror(PARSE_ERROR, ET_FATAL, "Missing matching 'EXEC SQL IFDEF / EXEC SQL IFNDEF'");
}
else if ( stacked_if_value[preproc_tos].else_branch )
else if (stacked_if_value[preproc_tos].else_branch)
mmerror(PARSE_ERROR, ET_FATAL, "Missing 'EXEC SQL ENDIF;'");
else
preproc_tos--;
ifcond = TRUE; BEGIN(xcond);
ifcond = TRUE;
BEGIN(xcond);
}
else
{
...
...
@@ -904,16 +904,16 @@ cppline {space}*#(.*\\{space})*.*{newline}
}
<C,xskip>{exec_sql}{else}{space}*";" { /* only exec sql endif pops the stack, so take care of duplicated 'else' */
if ( stacked_if_value[preproc_tos].else_branch ) {
if (stacked_if_value[preproc_tos].else_branch)
mmerror(PARSE_ERROR, ET_FATAL, "Duplicated 'EXEC SQL ELSE;'");
}
else
{
else
{
stacked_if_value[preproc_tos].else_branch = TRUE;
stacked_if_value[preproc_tos].condition =
(stacked_if_value[preproc_tos-1].condition &&
!
stacked_if_value[preproc_tos].condition);
!stacked_if_value[preproc_tos].condition);
if ( stacked_if_value[preproc_tos].condition
)
if (stacked_if_value[preproc_tos].condition
)
BEGIN(C);
else
BEGIN(xskip);
...
...
@@ -923,16 +923,16 @@ cppline {space}*#(.*\\{space})*.*{newline}
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
if (
stacked_if_value[preproc_tos].else_branch ) {
if (
stacked_if_value[preproc_tos].else_branch)
mmerror(PARSE_ERROR, ET_FATAL, "Duplicated 'EXEC SQL ELSE;'");
}
else
{
else
{
stacked_if_value[preproc_tos].else_branch = TRUE;
stacked_if_value[preproc_tos].condition =
(stacked_if_value[preproc_tos-1].condition &&
!
stacked_if_value[preproc_tos].condition);
!stacked_if_value[preproc_tos].condition);
if (
stacked_if_value[preproc_tos].condition
)
if (
stacked_if_value[preproc_tos].condition
)
BEGIN(C);
else
BEGIN(xskip);
...
...
@@ -945,12 +945,12 @@ cppline {space}*#(.*\\{space})*.*{newline}
}
}
<C,xskip>{exec_sql}{endif}{space}*";" {
if ( preproc_tos == 0
)
if (preproc_tos == 0
)
mmerror(PARSE_ERROR, ET_FATAL, "Unmatched 'EXEC SQL ENDIF;'");
else
preproc_tos--;
if ( stacked_if_value[preproc_tos].condition
)
if (stacked_if_value[preproc_tos].condition
)
BEGIN(C);
else
BEGIN(xskip);
...
...
@@ -959,12 +959,12 @@ cppline {space}*#(.*\\{space})*.*{newline}
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
if (
preproc_tos == 0
)
if (
preproc_tos == 0
)
mmerror(PARSE_ERROR, ET_FATAL, "Unmatched 'EXEC SQL ENDIF;'");
else
preproc_tos--;
if (
stacked_if_value[preproc_tos].condition
)
if (
stacked_if_value[preproc_tos].condition
)
BEGIN(C);
else
BEGIN(xskip);
...
...
@@ -979,32 +979,35 @@ cppline {space}*#(.*\\{space})*.*{newline}
<xskip>{other} { /* ignore */ }
<xcond>{identifier}{space}*";" {
if ( preproc_tos >= MAX_NESTED_IF-1 ) {
if (preproc_tos >= MAX_NESTED_IF-1)
mmerror(PARSE_ERROR, ET_FATAL, "Too many nested 'EXEC SQL IFDEF' conditions");
}
else
{
struct _defines *defptr;
unsigned int i;
/* skip the ";" and trailing whitespace. Note that yytext contains
at least one non-space character plus the ";" */
for ( i = strlen(yytext)-2;
/*
* Skip the ";" and trailing whitespace. Note that yytext
* contains at least one non-space character plus the ";"
*/
for (i = strlen(yytext)-2;
i > 0 && isspace((unsigned char) yytext[i]);
i-- )
{}
;
yytext[i+1] = '\0';
for ( defptr = defines; defptr != NULL &&
( strcmp(yytext, defptr->old) != 0 ); defptr = defptr->next );
for (defptr = defines;
defptr != NULL && strcmp(yytext, defptr->old) != 0;
defptr = defptr->next)
;
preproc_tos++;
stacked_if_value[preproc_tos].else_branch = FALSE;
stacked_if_value[preproc_tos].condition =
( (defptr ? ifcond : !ifcond) && stacked_if_value[preproc_tos-1].condition )
;
(defptr ? ifcond : !ifcond) && stacked_if_value[preproc_tos-1].condition
;
}
if ( stacked_if_value[preproc_tos].condition
)
if (stacked_if_value[preproc_tos].condition
)
BEGIN C;
else
BEGIN(xskip);
...
...
@@ -1048,7 +1051,8 @@ cppline {space}*#(.*\\{space})*.*{newline}
<incl>[^;\<\>\"]+";" { parse_include(); }
<<EOF>> {
if (yy_buffer == NULL) {
if (yy_buffer == NULL)
{
if ( preproc_tos > 0 )
{
preproc_tos = 0;
...
...
@@ -1168,10 +1172,10 @@ parse_include(void)
* skip the ";" if there is one and trailing whitespace. Note that
* yytext contains at least one non-space character plus the ";"
*/
for (
i = strlen(yytext)-2;
for (i = strlen(yytext)-2;
i > 0 && isspace((unsigned char) yytext[i]);
i--
)
{}
i--
)
;
if (yytext[i] == ';')
i--;
...
...
@@ -1182,7 +1186,7 @@ parse_include(void)
/* If file name is enclosed in '"' remove these and look only in '.' */
/* Informix does look into all include paths though, except filename starts with '/' */
if (
(yytext[0] == '"' && yytext[i] == '"')
&&
if (
yytext[0] == '"' && yytext[i] == '"'
&&
((compat != ECPG_COMPAT_INFORMIX && compat != ECPG_COMPAT_INFORMIX_SE) || yytext[1] == '/'))
{
yytext[i] = '\0';
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment