From e3c29e6b014f6b1435bc73d18a85fb6c2a2e9f66 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Mon, 20 Mar 1995 14:02:24 +0000 Subject: [PATCH] %option yylineno support --- flex.skl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flex.skl b/flex.skl index 3293100..66059e9 100644 --- a/flex.skl +++ b/flex.skl @@ -499,7 +499,7 @@ yy_find_action: YY_DO_BEFORE_ACTION; -%% code for yylineno update (if -l) goes here +%% code for yylineno update goes here do_action: /* This label is used only to access EOF actions. */ @@ -646,6 +646,7 @@ yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout ) yy_init = 1; yy_start = 0; yy_flex_debug = 0; + yylineno = 1; // this will only get updated if %option yylineno yy_did_buffer_switch_on_eof = 0; @@ -944,7 +945,7 @@ void yyFlexLexer::yyunput( int c, register char* yy_bp ) *--yy_cp = (char) c; -%% update yylineno here, if doing -l +%% update yylineno here yytext_ptr = yy_bp; yy_hold_char = *yy_cp; -- 2.50.1