comparison src/lex.l @ 970:9382316a8a01

[project @ 1994-12-12 06:03:34 by jwe]
author jwe
date Mon, 12 Dec 1994 06:03:34 +0000
parents ddfbda8bf9fb
children fe71abb43457
comparison
equal deleted inserted replaced
969:ddfbda8bf9fb 970:9382316a8a01
543 <<EOF>> { 543 <<EOF>> {
544 TOK_RETURN (END_OF_INPUT); 544 TOK_RETURN (END_OF_INPUT);
545 } 545 }
546 546
547 %{ 547 %{
548 // Identifiers. It matters if the next non-whitespace token is `=', 548 // Identifiers. Truncate the token at the first space or tab but
549 // so match that here. 549 // don't write directly on yytext.
550 %} 550 %}
551 551
552 {IDENT}{S}* { 552 {IDENT}{S}* {
553
554 // Truncate the token at the first space or tab but don't write
555 // directly on yytext.
556
557 static char *tok = 0; 553 static char *tok = 0;
558 delete [] tok; 554 delete [] tok;
559 tok = strip_trailing_whitespace (yytext); 555 tok = strip_trailing_whitespace (yytext);
560 return handle_identifier (tok, 0); 556 int c = yyinput ();
561 } 557 unput (c);
562 558 return handle_identifier (tok, (c == '='));
563 {IDENT}/{S}*= {
564 return handle_identifier (yytext, 1);
565 } 559 }
566 560
567 %{ 561 %{
568 // A new line character. New line characters inside matrix constants 562 // A new line character. New line characters inside matrix constants
569 // are handled by the <MATRIX> start state code above. 563 // are handled by the <MATRIX> start state code above.