Changeset 27

Show
Ignore:
Timestamp:
02/07/06 16:12:19 (3 years ago)
Author:
krobillard
Message:

Added orResetEnv().

Location:
trunk/orca
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/console.c

    r1 r27  
    7979            if( ! orErrorIsType(OR_ERROR_QUIT) ) 
    8080            { 
    81                 orPrintNative( orErrorThrown ); 
    82                 ret = -1; 
     81                if( ! orErrorIsType(OR_ERROR_HALT) ) 
     82                    orPrintNative( orErrorThrown ); 
     83                orResetEnv( &env ); 
     84                goto halt; 
     85                //ret = -1; 
    8386            } 
    8487        } 
     
    8790    { 
    8891        printf( "ORCA-Core %s (%s)\n", VERSION_STR, __DATE__ ); 
    89  
     92halt: 
    9093        while( 1 ) 
    9194        { 
     
    119122                    if( ! orErrorIsType(OR_ERROR_HALT) ) 
    120123                        orPrintNative( orErrorThrown ); 
    121                     orErrorClear; 
     124                    orResetEnv( &env ); 
    122125                } 
    123126                else 
  • trunk/orca/ovalue.c

    r26 r27  
    523523    memReport( 1 ); 
    524524#endif 
     525} 
     526 
     527 
     528/** 
     529  Recover from an error.  It does not modify any existing values; nothing 
     530  is freed and no files are closed. 
     531  This should only be used from outside a top-level eval call. 
     532*/ 
     533void orResetEnv( OEnv* env ) 
     534{ 
     535    env->callStack.used = 0; 
     536    env->dataStack.used = 0; 
     537    env->quickHoldsTop = env->quickHolds; 
     538    env->error = 0;      //orErrorClear; 
    525539} 
    526540 
  • trunk/orca/ovalue.h

    r26 r27  
    384384void    orInitEnv( OEnv*, int dataStackSize, int callStackSize ); 
    385385void    orFreeEnv( OEnv* ); 
     386void    orResetEnv( OEnv* ); 
    386387void    orAtomStr( OAtom, OString* ); 
    387388OAtom   orInternAtom( const char* str, int len ); 
  • trunk/orca/qt/main.cpp

    r1 r27  
    6060                OPEN_CONSOLE 
    6161 
    62                 if( orErrorIsType(OR_ERROR_HALT) ) 
     62                if( ! orErrorIsType(OR_ERROR_HALT) ) 
    6363                { 
    64                     orErrorClear; 
    65                     // Reset stack. 
    66                     orEnv->dataStack.used = 0; 
    67                     orEnv->callStack.used = 0; 
     64                    orResetEnv( &env ); 
    6865                    goto halt; 
    6966                } 
     
    111108                    if( ! orErrorIsType(OR_ERROR_HALT) ) 
    112109                        orPrintNative( orErrorThrown ); 
    113                     orErrorClear; 
     110                    orResetEnv( &env ); 
    114111                } 
    115112                else