Changeset 452 for branches/thune
- Timestamp:
- 08/19/07 18:31:07 (15 months ago)
- Location:
- branches/thune/thread_safe
- Files:
-
- 5 modified
-
charset.c (modified) (1 diff)
-
doc/thune.vim (modified) (2 diffs)
-
make.c (modified) (3 diffs)
-
print.c (modified) (3 diffs)
-
tokenize.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/charset.c
r451 r452 37 37 38 38 39 /* Word: 0-9 a-z A-Z ?!. '+-*&|=_~ and all ascii >= 127 */39 /* Word: 0-9 a-z A-Z ?!.+-*&|=_~ and all ascii >= 127 */ 40 40 uint8_t charset_word[32] = { 41 41 #ifdef UR_CONFIG_MACROS 42 0x00,0x00,0x00,0x00,0x C2,0x6C,0xFF,0xA3, // Don't allow < >42 0x00,0x00,0x00,0x00,0x42,0x6C,0xFF,0xA3, // Don't allow < > 43 43 #else 44 0x00,0x00,0x00,0x00,0x C2,0x6C,0xFF,0xF3,44 0x00,0x00,0x00,0x00,0x42,0x6C,0xFF,0xF3, 45 45 #endif 46 46 0xFE,0xFF,0xFF,0x97,0xFF,0xFF,0xFF,0x57, -
branches/thune/thread_safe/doc/thune.vim
r451 r452 18 18 syn case ignore 19 19 20 " As per current users documentation21 20 if version < 600 22 set isk =@,48-57,?,!,.,',+,-,*,&,\|,=,_,~21 set iskeyword=@,48-57,?,!,.,+,-,*,&,\|,=,_,~ 23 22 else 24 setlocal isk =@,48-57,?,!,.,',+,-,*,&,\|,=,_,~23 setlocal iskeyword=@,48-57,?,!,.,+,-,*,&,\|,=,_,~ 25 24 endif 26 25 … … 85 84 " Tuples 86 85 syn match thuneTuple "\(\d\+\.\)\{2,}" 87 88 86 " Characters 89 syn region thuneChar oneline start="'" end="'" contains=thuneSpecialChar 87 syn match thuneChar "'\^\=.'" 88 "syn match thuneChar "'\S\+'" 89 90 90 syn match thuneSpecialChar contained "\^[^[:space:][]" 91 91 syn match thuneSpecialChar contained "%\d\+" -
branches/thune/thread_safe/make.c
r450 r452 538 538 Returns -1 if failed. 539 539 */ 540 static int_escapedCharacter( const char** cp, const char* end )540 int ur_escapedCharacter( const char** cp, const char* end ) 541 541 { 542 542 int val; … … 649 649 { 650 650 ++cp; 651 *out++ = _escapedCharacter( &cp, end );651 *out++ = ur_escapedCharacter( &cp, end ); 652 652 } 653 653 else … … 1481 1481 { 1482 1482 ++spA; 1483 ur_char(res) = _escapedCharacter( (const char**) &spA,1484 spB );1483 ur_char(res) = ur_escapedCharacter( 1484 (const char**) &spA, spB ); 1485 1485 } 1486 1486 else -
branches/thune/thread_safe/print.c
r450 r452 32 32 33 33 extern int copyUtf16ToAscii( char* dest, const uint16_t* src, int len ); 34 35 36 static char charStr[] = "'?'";37 34 38 35 … … 1047 1044 switch( ur_int(val) ) 1048 1045 { 1049 case '\0':1050 append( out, "'^0'", 4 );1051 break;1052 1053 1046 case '\a': 1054 1047 append( out, "'^(bell)'", 9 ); … … 1080 1073 1081 1074 default: 1082 charStr[1] = (char) ur_int(val); 1083 append(out, charStr, 3); 1075 { 1076 char cstr[ 4 ]; 1077 cstr[0] = '\''; 1078 if( ur_int(val) < 10 ) 1079 { 1080 cstr[1] = '^'; 1081 cstr[2] = ur_int(val) + '0'; 1082 cstr[3] = '\''; 1083 append( out, cstr, 4 ); 1084 } 1085 else 1086 { 1087 cstr[1] = (char) ur_int(val); 1088 cstr[2] = '\''; 1089 append(out, cstr, 3); 1090 } 1091 } 1084 1092 break; 1085 1093 } -
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 }
