Mercurial > hg > octave-nkf
diff src/variables.cc @ 984:6aeb8fdc27d4
[project @ 1994-12-14 17:51:23 by jwe]
author | jwe |
---|---|
date | Wed, 14 Dec 1994 17:52:04 +0000 |
parents | 58f0c171bbbd |
children | 18be848f10a9 |
line wrap: on
line diff
--- a/src/variables.cc +++ b/src/variables.cc @@ -505,21 +505,38 @@ int c; while ((c = getc (ffile)) != EOF) { + current_input_column++; if (in_comment) { if (c == '\n') - in_comment = 0; + { + input_line_number++; + current_input_column = 0; + in_comment = 0; + } } else { - if (c == ' ' || c == '\t' || c == '\n') - continue; - else if (c == '%' || c == '#') - in_comment = 1; - else + switch (c) { + case ' ': + case '\t': + break; + + case '\n': + input_line_number++; + current_input_column = 0; + continue; + + case '%': + case '#': + in_comment = 1; + break; + + default: + current_input_column--; ungetc (c, ffile); - break; + return; } } } @@ -1397,9 +1414,9 @@ 0, 0, 1, automatic_replot, "if true, auto-insert a replot command when a plot changes"); - DEFVAR ("commas_in_literal_matrix", SBV_commas_in_literal_matrix, "", - 0, 0, 1, commas_in_literal_matrix, - "control auto-insertion of commas in literal matrices"); + DEFVAR ("whitespace_in_literal_matrix", SBV_whitespace_in_literal_matrix, "", + 0, 0, 1, whitespace_in_literal_matrix, + "control auto-insertion of commas and semicolons in literal matrices"); DEFVAR ("default_save_format", SBV_default_save_format, "ascii", 0, 0, 1, sv_default_save_format,