diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1994-12-06 21:28:46 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1994-12-06 21:28:46 +0000 |
commit | 5150784af44c3f7de8ae95a304c53e19f90b01a2 (patch) | |
tree | a9bd304f629f5b2f396317262591f8cd0c3dcbc7 /gen.c | |
parent | da80fdccc7fc31b8a1789d44f33f613699a19aa5 (diff) |
input() maintains BOL
Diffstat (limited to 'gen.c')
-rw-r--r-- | gen.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -1504,8 +1504,21 @@ void make_tables() } skelout(); - if ( lex_compat ) - { /* update yylineno inside of input() */ + /* Update BOL and yylineno inside of input(). */ + if ( bol_needed ) + { + indent_puts( "yy_current_buffer->yy_at_bol = (c == '\\n');" ); + if ( lex_compat ) + { + indent_puts( "if ( yy_current_buffer->yy_at_bol )" ); + indent_up(); + indent_puts( "++yylineno;" ); + indent_down(); + } + } + + else if ( lex_compat ) + { indent_puts( "if ( c == '\\n' )" ); indent_up(); indent_puts( "++yylineno;" ); |