# HG changeset patch # User jwe # Date 785432709 0 # Node ID c4827d0fe063506704b83353772e2cc6bf0bae52 # Parent 16062e9a6b7e5ed44564ba02fec4f6cdc33ea104 [project @ 1994-11-21 15:45:09 by jwe] diff -r 16062e9a6b7e -r c4827d0fe063 src/lex.l --- a/src/lex.l Mon Nov 21 15:41:30 1994 +0000 +++ b/src/lex.l Mon Nov 21 15:45:09 1994 +0000 @@ -919,7 +919,9 @@ } // Check to see if a character string matches any one of the plot -// option keywords. +// option keywords. Don't match abbreviations for clear, since that's +// not a gnuplot keyword (users will probably only expect to be able +// to abbreviate actual gnuplot keywords). static int is_plot_keyword (char *s) @@ -931,18 +933,15 @@ else if (almost_match ("using", s)) { in_plot_using = 1; - past_plot_range = 1; return USING; } else if (almost_match ("with", s)) { in_plot_style = 1; - past_plot_range = 1; return WITH; } - else if (almost_match ("clear", s)) + else if (strcmp ("clear", s) == 0) { - past_plot_range = 1; return CLEAR; } else @@ -1425,17 +1424,21 @@ // See if we have a plot keyword (title, using, with, or clear). - int plot_option_kw = is_plot_keyword (tok); - if (plotting && cant_be_identifier && plot_option_kw) - TOK_RETURN (plot_option_kw); - + if (plotting) + { // Yes, we really do need both of these plot_range variables. One // is used to mark when we are past all possiblity of a plot range, // the other is used to mark when we are actually between the square // brackets that surround the range. - if (plotting && ! in_plot_range) - past_plot_range = 1; + if (! in_plot_range) + past_plot_range = 1; + + int plot_option_kw = is_plot_keyword (tok); + + if (cant_be_identifier && plot_option_kw) + TOK_RETURN (plot_option_kw); + } // If we are looking at a text style function, set up to gobble its // arguments. These are also reserved words, but only because it