simpler lineno init
authorMarko Kreen <markokr@gmail.com>
Wed, 31 Oct 2007 07:41:44 +0000 (07:41 +0000)
committerMarko Kreen <markokr@gmail.com>
Wed, 31 Oct 2007 07:41:44 +0000 (07:41 +0000)
src/parser.y
src/scanner.l

index ddcd1bd88525409b17442fb91e9e739f37198437..85f439f477e6d7b0c64fae2949d7d725c6041d2b 100644 (file)
@@ -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);
 
index d5a1000c6a75a9d902789411ffc57ab9cdba2a2b..0ad2f4604a8264f798f75c42d31c717446b02508 100644 (file)
@@ -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 */