# HG changeset patch # User jwe # Date 1129222703 0 # Node ID 179096e8e57fcb58c6e39491afbfd81e349e7693 # Parent eacb3f5cfb993ecf74be8b38c12dbf667dbb3fa4 [project @ 2005-10-13 16:58:23 by jwe] diff -r eacb3f5cfb99 -r 179096e8e57f src/ChangeLog --- a/src/ChangeLog Thu Oct 13 16:51:04 2005 +0000 +++ b/src/ChangeLog Thu Oct 13 16:58:23 2005 +0000 @@ -1,3 +1,8 @@ +2005-10-13 John W. Eaton + + * DLD-FUNCTIONS/gplot.l (F__gnuplot_raw__): + Call print_usage with correct function name. + 2005-10-12 John W. Eaton * DLD-FUNCTIONS/gplot.l: Major cleanup. diff -r eacb3f5cfb99 -r 179096e8e57f src/DLD-FUNCTIONS/gplot.l --- a/src/DLD-FUNCTIONS/gplot.l Thu Oct 13 16:51:04 2005 +0000 +++ b/src/DLD-FUNCTIONS/gplot.l Thu Oct 13 16:58:23 2005 +0000 @@ -1,3 +1,26 @@ +/* + +Copyright (C) 2004 John W. Eaton and Teemu Ikonen + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octavee; see the file COPYING. If not, write to the Free +Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. + +*/ + %option prefix="gpt" %option noyywrap @@ -285,73 +308,6 @@ return 0; } -// This is used to handle single-quote delimited strings. Kludge alert. - -static int -handle_string (char delim) -{ - static char *buf = 0; - - int c; - bool escape_pending = false; - - std::string strbuf (1, static_cast (delim)); - - while ((c = yyinput ()) != EOF) - { - if (c == '\\') - { - if (escape_pending) - { - strbuf += static_cast (c); - escape_pending = false; - } - else - { - strbuf += static_cast (c); - escape_pending = true; - } - continue; - } - else if (c == '\n') - { - error ("unterminated string constant"); - break; - } - else if (c == delim) - { - if (escape_pending) - strbuf += static_cast (c); - else - { - c = yyinput (); - - if (c == delim) - { - strbuf += static_cast (c); - strbuf += static_cast (c); - } - else - { - yyunput (c, yytext); - strbuf += static_cast (delim); - delete [] buf; - yytext = strsave (strbuf.c_str ()); - return STRING; - } - } - } - else - strbuf += static_cast (c); - - escape_pending = false; - } - - throw gpt_parse_error ("unterminated string"); - - return 0; -} - // (Probably not necessesary, but current Matlab style plot functions // break without this (they emit too short gnuplot commands))