aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/pgc.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/pgc.l')
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index d9d09d90f75..55758061f7a 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.99 2002/09/02 06:11:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.100 2002/10/21 13:09:31 meskes Exp $
*
*-------------------------------------------------------------------------
*/
@@ -117,7 +117,7 @@ xbcat {quote}{whitespace_with_newline}{quote}
*/
xhstart [xX]{quote}
xhstop {quote}
-xhinside [^']+
+xhinside [^']*
xhcat {quote}{whitespace_with_newline}{quote}
/* National character
@@ -333,7 +333,7 @@ cppline {space}*#(.*\\{space})*.*
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input.");
yylval.str = literalbuf;
- return BITCONST;
+ return BCONST;
}
<xh>{xhinside} |
@@ -346,23 +346,11 @@ cppline {space}*#(.*\\{space})*.*
token_start = yytext;
BEGIN(xh);
startlit();
+ addlitchar('x');
}
<xh>{xhstop} {
- long val;
- char* endptr;
-
- BEGIN(SQL);
- errno = 0;
- val = strtol(literalbuf, &endptr, 16);
- if (*endptr != '\0' || errno == ERANGE
-#ifdef HAVE_LONG_INT_64
- /* if long > 32 bits, check for overflow of int4 */
- || val != (long) ((int32) val)
-#endif
- )
- mmerror(PARSE_ERROR, ET_ERROR, "Bad hexadecimal integer input");
- yylval.ival = val;
- return ICONST;
+ yylval.str = literalbuf;
+ return XCONST;
}
<xh><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated hexadecimal integer"); }