From: Marko Kreen Date: Wed, 31 Oct 2007 07:41:44 +0000 (+0000) Subject: simpler lineno init X-Git-Tag: plproxy_2_0_3rc1~10 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=5fd05be9711616408f3c27c735210435862ab33d;p=plproxy.git simpler lineno init --- diff --git a/src/parser.y b/src/parser.y index ddcd1bd..85f439f 100644 --- a/src/parser.y +++ b/src/parser.y @@ -22,7 +22,6 @@ /* define scanner.c functions */ void plproxy_yy_scan_bytes(const char *bytes, int len); -void plproxy_yyset_lineno(int); /* avoid permanent allocations */ #define YYSTACK_USE_ALLOCA 1 @@ -151,8 +150,6 @@ void plproxy_run_parser(ProxyFunction *func, const char *body, int len) cur_sql = select_sql = NULL; - plproxy_yyset_lineno(1); - /* setup scanner */ plproxy_yy_scan_bytes(body, len); diff --git a/src/scanner.l b/src/scanner.l index d5a1000..0ad2f46 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -99,6 +99,7 @@ int plproxy_yylex_destroy(void) YY_CURRENT_BUFFER = NULL; yy_start = 0; yy_init = 1; + yylineno = 1; return 0; } @@ -107,11 +108,6 @@ int plproxy_yyget_lineno(void) return yylineno; } -void plproxy_yyset_lineno(int new_lineno) -{ - yylineno = new_lineno; -} - #endif /* own error handling */