Mercurial > hg > octave-nkf
diff src/parse.y @ 7723:74f5e0c7de9e
first pass at handling block comments
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 19 Apr 2008 01:59:31 -0400 |
parents | 4e2eafef689c |
children | 13820b9f5fd9 |
line wrap: on
line diff
--- a/src/parse.y +++ b/src/parse.y @@ -2845,12 +2845,16 @@ { c = getc (f); - if (c != '\n') + if (c == '\n') + input_line_number++; + else { ungetc (c, f); c = '\r'; } } + else if (c == '\n') + input_line_number++; return c; } @@ -2883,7 +2887,6 @@ break; case '\n': - input_line_number++; current_input_column = 0; break; @@ -2920,7 +2923,7 @@ if (eof) break; - txt = grab_comment_block (stdio_reader, eof); + txt = grab_comment_block (stdio_reader, true, eof); if (txt.empty ()) break; @@ -3028,9 +3031,6 @@ std::string help_txt = gobble_leading_white_space (ffile, eof); - if (! help_txt.empty ()) - help_buf.push (help_txt); - if (! eof) { std::string file_type; @@ -3079,6 +3079,9 @@ reset_parser (); + if (! help_txt.empty ()) + help_buf.push (help_txt); + if (parsing_script) prep_lexer_for_script ();