Mercurial > octave-nkf
comparison src/lex.l @ 4064:b4fa31442a78
[project @ 2002-09-26 21:10:45 by jwe]
author | jwe |
---|---|
date | Thu, 26 Sep 2002 21:10:46 +0000 |
parents | b79da8779a0e |
children | 5a82e874999b |
comparison
equal
deleted
inserted
replaced
4063:9de7822bbdc4 | 4064:b4fa31442a78 |
---|---|
240 } | 240 } |
241 | 241 |
242 <TEXT_FCN>[\;\,] { | 242 <TEXT_FCN>[\;\,] { |
243 if (lexer_flags.doing_set && strcmp (yytext, ",") == 0) | 243 if (lexer_flags.doing_set && strcmp (yytext, ",") == 0) |
244 { | 244 { |
245 TOK_PUSH_AND_RETURN (yytext, TEXT); | 245 TOK_PUSH_AND_RETURN (yytext, STRING); |
246 } | 246 } |
247 else | 247 else |
248 { | 248 { |
249 BEGIN 0; | 249 BEGIN 0; |
250 if (strcmp (yytext, ",") == 0) | 250 if (strcmp (yytext, ",") == 0) |
259 return handle_string (yytext[0], true); | 259 return handle_string (yytext[0], true); |
260 } | 260 } |
261 | 261 |
262 <TEXT_FCN>[^ \t\n\;\,\"\'][^ \t\n\;\,]*{S}* { | 262 <TEXT_FCN>[^ \t\n\;\,\"\'][^ \t\n\;\,]*{S}* { |
263 std::string tok = strip_trailing_whitespace (yytext); | 263 std::string tok = strip_trailing_whitespace (yytext); |
264 TOK_PUSH_AND_RETURN (tok, TEXT); | 264 TOK_PUSH_AND_RETURN (tok, STRING); |
265 } | 265 } |
266 | 266 |
267 %{ | 267 %{ |
268 // For this and the next two rules, we're looking at ']', and we | 268 // For this and the next two rules, we're looking at ']', and we |
269 // need to know if the next token is `=' or `=='. | 269 // need to know if the next token is `=' or `=='. |
2014 if (delim == '"') | 2014 if (delim == '"') |
2015 gripe_matlab_incompatible ("\" used as string delimiter"); | 2015 gripe_matlab_incompatible ("\" used as string delimiter"); |
2016 else if (delim == '\'') | 2016 else if (delim == '\'') |
2017 gripe_single_quote_string (); | 2017 gripe_single_quote_string (); |
2018 | 2018 |
2019 return TEXT; | 2019 return STRING; |
2020 } | 2020 } |
2021 } | 2021 } |
2022 } | 2022 } |
2023 else | 2023 else |
2024 { | 2024 { |