Changeset 451 for branches/thune

Show
Ignore:
Timestamp:
08/19/07 14:21:25 (15 months ago)
Author:
krobillard
Message:

A decimal/vec3 can now start with '.'. Vim syntax handles hex numbers.

Location:
branches/thune/thread_safe
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/charset.c

    r408 r451  
    2424 
    2525 
    26 /* Strict Word: a-z A-Z ?!.*&|=_~ and all ascii >= 127  */ 
     26/* Start of Word: a-z A-Z ?!.*&|=_~ and all ascii >= 127  */ 
    2727uint8_t charset_sword[32] = { 
    2828#ifdef UR_CONFIG_MACROS 
  • branches/thune/thread_safe/doc/thune.vim

    r442 r451  
    4949" Integers 
    5050syn match       thuneInteger    "\<[+-]\=\d\+\('\d*\)*\>" 
     51" Hex number 
     52syn match       thuneInteger    "\$\x\+" 
    5153" Decimals 
    5254syn match       thuneDecimal    "[+-]\=\(\d\+\('\d*\)*\)\=[,.]\d*\(e[+-]\=\d\+\)\=" 
     
    6668" DD.MM.YYYY format 
    6769syn match       thuneDate       "\d\{1,2}\.\d\{1,2}\.\d\{4}\>" 
    68 " Money 
    69 syn match       thuneMoney      "\a*\$\d\+\('\d*\)*\([,.]\d\+\)\=" 
    7070" Strings 
    7171syn region      thuneString     oneline start=+"+ skip=+^"+ end=+"+ contains=thuneSpecialChar 
  • branches/thune/thread_safe/tokenize.c

    r450 r451  
    310310    int tn;         // Each state can use tn & mode as it wishes. 
    311311    int mode = 0; 
    312     int eol = 0; 
     312    int sol = 0; 
    313313    int lines = 0; 
    314314#ifdef UR_CONFIG_MACROS 
     
    332332            { 
    333333                ++lines; 
    334                 eol = 1; 
     334                sol = 1; 
    335335            } 
    336336        } 
     
    342342            { 
    343343                ++it; 
     344                if( ch == '.' && (it != end) ) 
     345                { 
     346                    ch = *it; 
     347                    if( IS_DIGIT(ch) ) 
     348                    { 
     349                        --it; 
     350                        goto number; 
     351                    } 
     352                } 
    344353                goto word; 
    345354            } 
     
    347356            { 
    348357                ++it; 
    349                 goto integer; 
     358                goto number; 
    350359            } 
    351360            else 
     
    400409                        case '[': mode = UT_BLOCK; break; 
    401410                        case '(': mode = UT_PAREN; break; 
     411#ifdef UR_CONFIG_MACROS 
    402412                        case '<': mode = UT_MACRO; 
    403 #ifdef UR_CONFIG_MACROS 
    404413#ifdef MACRO_CONTEXT 
    405414                            if( ! macroNest ) 
     
    415424 
    416425                    ++stack.used; 
    417                     if( eol ) 
     426                    if( sol ) 
    418427                    { 
    419428                        cell->id.flags |= UR_FLAG_SOL; 
    420                         eol = 0; 
     429                        sol = 0; 
    421430                    } 
    422431                    break; 
     
    424433                case ']': 
    425434                case ')': 
     435#ifdef UR_CONFIG_MACROS 
    426436                case '>': 
     437#endif 
    427438                    if( stack.used == 1 ) 
    428439                    { 
     
    433444                    } 
    434445                    --stack.used; 
    435                     if( eol ) 
    436                         eol = 0; 
     446                    if( sol ) 
     447                        sol = 0; 
    437448#ifdef UR_CONFIG_MACROS 
    438449                    if( ch == '>' && macroNest ) 
     
    488499set_eol: 
    489500 
    490     if( eol ) 
     501    if( sol ) 
    491502    { 
    492503        cell->id.flags |= UR_FLAG_SOL; 
    493         eol = 0; 
     504        sol = 0; 
    494505    } 
    495506    goto start; 
     
    590601    ch = *it; 
    591602    if( IS_DIGIT(ch) ) 
    592         goto integer; 
     603        goto number; 
    593604    goto word; 
    594605 
     
    685696    syntaxError( "Invalid word" ); 
    686697 
    687 integer: 
     698number: 
    688699 
    689700    mode = UT_INT;