Mercurial > octave-nkf
comparison src/lex.l @ 2804:eedc2f3f61f7
[project @ 1997-03-11 04:34:50 by jwe]
author | jwe |
---|---|
date | Tue, 11 Mar 1997 04:48:53 +0000 |
parents | 2c0f259cf83d |
children | ae3cce876a8e |
comparison
equal
deleted
inserted
replaced
2803:f96fae33b877 | 2804:eedc2f3f61f7 |
---|---|
172 static int is_plot_keyword (const string& s); | 172 static int is_plot_keyword (const string& s); |
173 static int is_keyword (const string& s); | 173 static int is_keyword (const string& s); |
174 static string plot_style_token (const string& s); | 174 static string plot_style_token (const string& s); |
175 static symbol_record *lookup_identifier (const string& s); | 175 static symbol_record *lookup_identifier (const string& s); |
176 static void grab_help_text (void); | 176 static void grab_help_text (void); |
177 static int match_any (char c, char *s); | 177 static int match_any (char c, const char *s); |
178 static int next_token_is_bin_op (int spc_prev, char *yytext); | 178 static int next_token_is_bin_op (int spc_prev, char *yytext); |
179 static int next_token_is_postfix_unary_op (int spc_prev, char *yytext); | 179 static int next_token_is_postfix_unary_op (int spc_prev, char *yytext); |
180 static string strip_trailing_whitespace (char *s); | 180 static string strip_trailing_whitespace (char *s); |
181 static void handle_number (char *yytext); | 181 static void handle_number (char *yytext); |
182 static int handle_string (char delim, int text_style = 0); | 182 static int handle_string (char delim, int text_style = 0); |
853 static string | 853 static string |
854 plot_style_token (const string& s) | 854 plot_style_token (const string& s) |
855 { | 855 { |
856 string retval; | 856 string retval; |
857 | 857 |
858 static char *plot_styles[] = | 858 static const char *plot_styles[] = |
859 { | 859 { |
860 "boxes", | 860 "boxes", |
861 "boxerrorbars", | 861 "boxerrorbars", |
862 "boxxyerrorbars", | 862 "boxxyerrorbars", |
863 "candlesticks", | 863 "candlesticks", |
876 "xyerrorbars", | 876 "xyerrorbars", |
877 "yerrorbars", | 877 "yerrorbars", |
878 0, | 878 0, |
879 }; | 879 }; |
880 | 880 |
881 char **tmp = plot_styles; | 881 const char * const *tmp = plot_styles; |
882 while (*tmp) | 882 while (*tmp) |
883 { | 883 { |
884 if (almost_match (*tmp, s.c_str ())) | 884 if (almost_match (*tmp, s.c_str ())) |
885 { | 885 { |
886 retval = *tmp; | 886 retval = *tmp; |
1158 | 1158 |
1159 // Return 1 if the given character matches any character in the given | 1159 // Return 1 if the given character matches any character in the given |
1160 // string. | 1160 // string. |
1161 | 1161 |
1162 static int | 1162 static int |
1163 match_any (char c, char *s) | 1163 match_any (char c, const char *s) |
1164 { | 1164 { |
1165 char tmp; | 1165 char tmp; |
1166 while ((tmp = *s++) != '\0') | 1166 while ((tmp = *s++) != '\0') |
1167 { | 1167 { |
1168 if (c == tmp) | 1168 if (c == tmp) |