Skip to content
Snippets Groups Projects
Commit 4379ce83 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev
Browse files

Quick hack to get CHECK working for incoming betta.

parent 4587547f
Branches
Tags
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.19 1997/09/08 03:20:04 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.20 1997/09/12 09:01:46 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -303,6 +303,7 @@ CurScanPosition(void) ...@@ -303,6 +303,7 @@ CurScanPosition(void)
#endif /* !defined(FLEX_SCANNER) */ #endif /* !defined(FLEX_SCANNER) */
#ifdef FLEX_SCANNER #ifdef FLEX_SCANNER
static bool end_of_buf = false;
/* input routine for flex to read input from a string instead of a file */ /* input routine for flex to read input from a string instead of a file */
int int
myinput(char* buf, int max) myinput(char* buf, int max)
...@@ -320,17 +321,28 @@ myinput(char* buf, int max) ...@@ -320,17 +321,28 @@ myinput(char* buf, int max)
memcpy(buf, parseString, copylen); memcpy(buf, parseString, copylen);
buf[copylen] = '\0'; buf[copylen] = '\0';
parseCh = parseString; parseCh = parseString;
end_of_buf = false;
return copylen; return copylen;
} }
else else
{
end_of_buf = true;
return 0; /* end of string */ return 0; /* end of string */
}
} }
int int
CurScanPosition(void) CurScanPosition(void)
{ {
printf( "current position is %d\n", yy_c_buf_p - yy_current_buffer->yy_ch_buf - yyleng); int spos;
return (yy_c_buf_p - yy_current_buffer->yy_ch_buf - yyleng);
if ( end_of_buf )
spos = strlen (parseString) - strlen (yytext);
else
spos = yy_c_buf_p - yy_current_buffer->yy_ch_buf - yyleng;
printf( "current position is %d\n", spos);
return (spos);
} }
#endif /* FLEX_SCANNER */ #endif /* FLEX_SCANNER */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment