# HG changeset patch # User jwe # Date 1052862386 0 # Node ID b6bc72f02a9bc4480cb245ac384f2c58d5543f15 # Parent 6b191c6e6875ebdeba2172a9545ab36f47526a52 [project @ 2003-05-13 21:46:26 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-05-13 John W. Eaton + + * lex.l: Use yyunput (X, yytext) instead of unput (X) for newer + versions of flex. + 2003-05-01 John W. Eaton * load-save.cc (save_ascii_data): If saving a range with diff --git a/src/lex.l b/src/lex.l --- a/src/lex.l +++ b/src/lex.l @@ -246,13 +246,13 @@ . { BEGIN (NESTED_FUNCTION_BEGIN); - unput (yytext[0]); + yyunput (yytext[0], yytext); return ';'; } . { BEGIN (INITIAL); - unput (yytext[0]); + yyunput (yytext[0], yytext); prep_for_nested_function (); return FCN; } @@ -338,7 +338,7 @@ maybe_warn_separator_insert (';'); if (Vwhitespace_in_literal_matrix != 2) - unput (';'); + yyunput (';', yytext); } return (','); @@ -367,7 +367,7 @@ maybe_warn_separator_insert (';'); if (Vwhitespace_in_literal_matrix != 2) - unput (';'); + yyunput (';', yytext); } if (Vwhitespace_in_literal_matrix != 2) @@ -796,7 +796,7 @@ . { // EOF happens here if we are parsing nested functions. - unput (yytext[0]); + yyunput (yytext[0], yytext); int c = yyinput (); @@ -828,10 +828,10 @@ int c = yyinput (); - unput (c); + yyunput (c, yytext); if (spc_gobbled) - unput (' '); + yyunput (' ', yytext); lexer_flags.do_comma_insert = (lexer_flags.bracketflag && c == '['); } @@ -1444,7 +1444,7 @@ done: if (c) - unput (c); + yyunput (c, yytext); } // Return 1 if the given character matches any character in the given @@ -1499,12 +1499,12 @@ retval = true; } else - unput (c2); + yyunput (c2, yytext); } else retval = match_any (c1, ",;\n]"); - unput (c1); + yyunput (c1, yytext); return retval; } @@ -1527,10 +1527,10 @@ { int c1 = yyinput (); un_op = (c1 == '\''); - unput (c1); + yyunput (c1, yytext); } - unput (c0); + yyunput (c0, yytext); return un_op; } @@ -1579,7 +1579,7 @@ break; } - unput (c1); + yyunput (c1, yytext); } break; @@ -1603,7 +1603,7 @@ // A structure element reference is a binary op. bin_op = true; - unput (c1); + yyunput (c1, yytext); } break; @@ -1633,7 +1633,7 @@ if (c1 == '=') bin_op = true; - unput (c1); + yyunput (c1, yytext); } break; @@ -1641,7 +1641,7 @@ break; } - unput (c0); + yyunput (c0, yytext); return bin_op; } @@ -1847,7 +1847,7 @@ octave_comment_buffer::append (comment_buf); done: - unput (c); + yyunput (c, yytext); current_input_column--; return retval; } @@ -2007,7 +2007,7 @@ } } - unput (c); + yyunput (c, yytext); return false; cleanup: @@ -2018,7 +2018,7 @@ int len = s.length (); while (len--) - unput (s[len]); + yyunput (s[len], yytext); return false; } @@ -2038,12 +2038,12 @@ return true; else { - unput (c2); - unput (c1); + yyunput (c2, yytext); + yyunput (c1, yytext); } } else - unput (c1); + yyunput (c1, yytext); return false; } @@ -2064,7 +2064,7 @@ || (c == '\\' && have_continuation ())) retval = eat_whitespace (); else - unput (c); + yyunput (c, yytext); return retval; } @@ -2124,7 +2124,7 @@ buf << static_cast (c); else { - unput (c); + yyunput (c, yytext); buf << OSSTREAM_ENDS; std::string s = do_string_escapes (OSSTREAM_STR (buf)); OSSTREAM_FREEZE (buf); @@ -2175,7 +2175,7 @@ case '=': { int c1 = yyinput (); - unput (c1); + yyunput (c1, yytext); if (c1 != '=') retval = true; } @@ -2190,7 +2190,7 @@ case '|': { int c1 = yyinput (); - unput (c1); + yyunput (c1, yytext); if (c1 == '=') retval = true; } @@ -2202,11 +2202,11 @@ if (match_any (c1, "+-*/\\")) { int c2 = yyinput (); - unput (c2); + yyunput (c2, yytext); if (c2 == '=') retval = true; } - unput (c1); + yyunput (c1, yytext); } break; @@ -2216,11 +2216,11 @@ if (c1 == '>') { int c2 = yyinput (); - unput (c2); + yyunput (c2, yytext); if (c2 == '=') retval = true; } - unput (c1); + yyunput (c1, yytext); } break; @@ -2230,11 +2230,11 @@ if (c1 == '<') { int c2 = yyinput (); - unput (c2); + yyunput (c2, yytext); if (c2 == '=') retval = true; } - unput (c1); + yyunput (c1, yytext); } break; @@ -2242,7 +2242,7 @@ break; } - unput (c0); + yyunput (c0, yytext); return retval; } @@ -2268,7 +2268,7 @@ else { int c1 = yyinput (); - unput (c1); + yyunput (c1, yytext); if (lexer_flags.bracketflag) { @@ -2286,7 +2286,7 @@ if (Vwhitespace_in_literal_matrix != 2) { - unput (','); + yyunput (',', yytext); return ']'; } } @@ -2312,8 +2312,8 @@ int c1 = yyinput (); int c2 = yyinput (); - unput (c2); - unput (c1); + yyunput (c2, yytext); + yyunput (c1, yytext); int sep_op = next_token_is_sep_op (); @@ -2337,14 +2337,14 @@ // If there is a space, we only insert a comma if we are // trying to be Matlab-like. if (Vwhitespace_in_literal_matrix == 1) - unput (','); + yyunput (',', yytext); } else { maybe_warn_separator_insert (','); if (Vwhitespace_in_literal_matrix != 2) - unput (','); + yyunput (',', yytext); } } } @@ -2447,13 +2447,13 @@ if (c1 == '=') { int c2 = yyinput (); - unput (c2); + yyunput (c2, yytext); if (c2 != '=') next_tok_is_eq = true; } - unput (c1); + yyunput (c1, yytext); // Make sure we put the return values of a function in the symbol // table that is local to the function.