Changeset 452 for branches/thune/thread_safe/tokenize.c
- Timestamp:
- 08/19/07 18:31:07 (15 months ago)
- Files:
-
- 1 modified
-
branches/thune/thread_safe/tokenize.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/tokenize.c
r451 r452 31 31 32 32 extern void ur_bindDefault( UThread*, UIndex blkN ); 33 extern int ur_escapedCharacter( const char** cp, const char* end ); 33 34 34 35 … … 546 547 quote: 547 548 548 if( ((end - it) > 1) && it[1] == '\'' )549 {550 cell = ur_appendCell( BLOCK, UT_CHAR );551 ur_int(cell) = token[1];552 it += 2;553 goto set_eol;554 }555 556 549 mode = UT_LITWORD; 557 550 558 551 SCAN_LOOP 559 if( ch == '/' ) 552 if( ch == '\'' ) 553 { 554 mode = UT_CHAR; 555 break; 556 } 557 else if( ch == '/' ) 560 558 { 561 559 mode = UT_LITSELECT; … … 563 561 else if( ur_bitIsSet( charset_delimiters, ch ) ) // '[' 'word[] 564 562 { 563 if( it == (token + 1) ) 564 { 565 ++it; 566 if( (it != end) && (*it == '\'') ) 567 goto make_char; 568 goto quote_err; 569 } 565 570 break; 566 571 } … … 572 577 if( it == token ) 573 578 goto quote_err; 574 if( mode == UT_LITWORD ) 579 580 if( mode == UT_CHAR ) 581 { 582 ch = *token; 583 if( ch == '^' ) 584 { 585 ++token; 586 ch = ur_escapedCharacter( &token, it ); 587 if( ch < 0 ) 588 { 589 syntaxError( "Invalid char" ); 590 } 591 } 592 make_char: 593 ++it; 594 cell = ur_appendCell( BLOCK, UT_CHAR ); 595 ur_int(cell) = ch; 596 } 597 else if( mode == UT_LITWORD ) 575 598 { 576 599 cell = ur_appendWord( BLOCK, UT_LITWORD, token, it - token ); … … 632 655 { 633 656 mode = WORD_COLON; 634 break;635 }636 if( ch == '\'' )637 {638 mode = UT_CHAR;639 657 break; 640 658 }
