Changeset 491

Show
Ignore:
Timestamp:
10/20/07 18:18:45 (12 months ago)
Author:
krobillard
Message:

Macros are now created with caret followed by paren: (...)

Location:
trunk/thune
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/charset.c

    r458 r491  
    2626/* Start of Word: a-z A-Z ?!.*&|=_~ and all ascii >= 127  */ 
    2727uint8_t charset_sword[32] = { 
    28 #ifdef UR_CONFIG_MACROS 
    29         0x00,0x00,0x00,0x00,0x42,0x44,0x00,0xA0,    // Don't allow < > 
    30 #else 
    3128        0x00,0x00,0x00,0x00,0x42,0x44,0x00,0xF0, 
    32 #endif 
    3329        0xFE,0xFF,0xFF,0x97,0xFF,0xFF,0xFF,0x57, 
    3430        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 
     
    3935/* Word: 0-9 a-z A-Z ?!.+-*&|=_~ and all ascii >= 127 */ 
    4036uint8_t charset_word[32] = { 
    41 #ifdef UR_CONFIG_MACROS 
    42         0x00,0x00,0x00,0x00,0x42,0x6C,0xFF,0xA3,    // Don't allow < > 
    43 #else 
    4437        0x00,0x00,0x00,0x00,0x42,0x6C,0xFF,0xF3, 
    45 #endif 
    4638        0xFE,0xFF,0xFF,0x97,0xFF,0xFF,0xFF,0x57, 
    4739        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 
  • trunk/thune/gl/scripts/view.t

    r468 r491  
    11; Thune GL View 
    22 
    3 <"scripts/stars.t" load do> 
     3^("scripts/stars.t" load do) 
    44 
    55;"scripts/timer_bar.t" load do 
     
    3333        particle 
    3434        shader star-sh 
    35         call <400 make-stars> 
     35        call ^(400 make-stars) 
    3636 
    3737        particle/sprite 
    3838        shader bstar-sh 
    39         call <10 make-stars> 
     39        call ^(10 make-stars) 
    4040    pop 
    4141    ;particle/off 
     
    128128    [ 
    129129        model 
    130         shader ent-shader   ; FIXME: Causes text not to render. 
     130        shader ent-shader 
    131131        call ent-dl 
    132132 
     
    256256        dup :mouse-pos 
    257257        mouse-pos/5 [ 
    258             <mouse-lb> [mouse-pos/3 mouse-pos/4 view-cam/turntable] 
    259             <mouse-mb> [light-amb mouse-pos/4 0.02 mul add :light-amb] 
    260             <mouse-rb> [mouse-pos/3 mouse-pos/4 move-light] 
     258            ^(mouse-lb) [mouse-pos/3 mouse-pos/4 view-cam/turntable] 
     259            ^(mouse-mb) [light-amb mouse-pos/4 0.02 mul add :light-amb] 
     260            ^(mouse-rb) [mouse-pos/3 mouse-pos/4 move-light] 
    261261        ] case 
     262        ; KR "------------" print .s 
    262263    ] 
    263264 
     
    301302        text text-pos "Model Demo 1" 
    302303        ;enable/? 
    303         image/trans logo-pos <"image/warpfleetc.png" load.tex.clamp> 
     304        image/trans logo-pos ^("image/warpfleetc.png" load.tex.clamp) 
    304305 
    305306        ;shader matte 
  • trunk/thune/gl/test.t

    r458 r491  
    22 
    33 
    4 "data_loc" change-dir 
     4"local_data" change-dir 
    55 
    66;1024,768 'fullscreen display 
  • trunk/thune/tokenize.c

    r480 r491  
    400400                    goto dollar; 
    401401 
     402#ifdef UR_CONFIG_MACROS 
     403                case '^': 
     404                    ++it; 
     405                    if( it == end || *it != '(' ) 
     406                        goto word; 
     407                    // Fall through... 
     408#endif 
    402409                case '[': 
    403410                case '(': 
    404                 case '<': 
    405411                    ur_arrayReserve( &stack, sizeof(UIndex), stack.used+1 ); 
    406412                    STACK[ stack.used ] = ur_makeBlock( 0 ); 
     
    411417                        case '(': mode = UT_PAREN; break; 
    412418#ifdef UR_CONFIG_MACROS 
    413                         case '<': mode = UT_MACRO; 
     419                        case '^': mode = UT_MACRO; 
    414420#ifdef MACRO_CONTEXT 
    415421                            if( ! macroNest ) 
     
    434440                case ']': 
    435441                case ')': 
    436 #ifdef UR_CONFIG_MACROS 
    437                 case '>': 
    438 #endif 
    439442                    if( stack.used == 1 ) 
    440443                    { 
     
    448451                        sol = 0; 
    449452#ifdef UR_CONFIG_MACROS 
    450                     if( ch == '>' && macroNest ) 
     453                    if( ch == ')' && macroNest ) 
    451454                    { 
    452455                        UCell* otos; 
    453456                        UBlock* blk; 
    454457                        UIndex blkN; 
     458 
     459                        blk = BLOCK; 
     460                        if( (blk->used < 1) || 
     461                            (ur_type(blk->ptr.cells + blk->used - 1) != 
     462                                UT_MACRO) ) 
     463                            break; 
    455464 
    456465                        otos = UR_TOS; 
     
    467476                        } 
    468477 
    469                         blk = ur_blockPtr( STACK[stack.used - 1] ); 
     478                        blk = BLOCK; 
    470479                        --blk->used;    // Remove macro. 
    471480