Changeset 89dcccd4721f29950f4455a999e0f47593678065

Show
Ignore:
Timestamp:
04/11/10 01:48:11 (2 years ago)
Author:
Philip Herron <redbrain@…>
Parents:
b2bc0049fdf32f673fc66b045a4bb2b3ca350e40
Children:
8f36f3a9825b8570f8db262e1bf3bea0a64e07d5
git-committer:
Philip Herron <redbrain@omicron.(none)> / 2010-04-11T01:48:11Z+0100
Message:

more code time for sleep

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • include/crules/objects.h

    rb2bc004 r89dcccd  
    7373 
    7474extern crl_symbol_obj * crl_obj_class_dispatch_symbol( const char * , crl_context_table * , 
    75                                                        enum crl_class_ctx_type_t , 
    76                                                        crl_obj_state_t * ); 
     75                                                       enum crl_class_ctx_type_t , crl_obj_state_t *, 
     76                                                       crl_symbol_obj * ); 
     77 
     78extern crl_symbol_obj * crl_obj_class_dispatch_functor( const char *, crl_context_table *, 
     79                                                        crl_obj_state_t *, crl_symbol_obj * ); 
    7780 
    7881// -------------------------------------------------------------------------- 
  • src/obj_class.c

    rb2bc004 r89dcccd  
    4040 
    4141crl_symbol_obj * 
    42 crl_obj_class_dispatch_symbol( const char * ident, 
    43                                crl_context_table * context, 
    44                                enum crl_class_ctx_type_t type, 
    45                                crl_obj_state_t * obj ) 
     42crl_obj_class_dispatch_functor( const char * ident, crl_context_table * context, 
     43                                crl_obj_state_t * obj, crl_symbol_obj * call ) 
    4644{ 
    4745  crl_symbol_obj *retval = NULL; 
     46 
     47  crl_context_table *object_ctx = (crl_context_table*) 
     48    crl_malloc( sizeof(crl_context_table) ); 
     49  crl_context_init_table( &object_ctx ); 
     50  crl_context_push( (obj->context), object_ctx ); 
     51 
     52   
     53 
     54 
    4855  return retval; 
    4956} 
     57 
     58crl_symbol_obj * 
     59crl_obj_class_dispatch_symbol( const char * ident, crl_context_table * context, 
     60                               enum crl_class_ctx_type_t type, crl_obj_state_t * obj, 
     61                               crl_symbol_obj * functor_call ) 
     62{ 
     63  crl_symbol_obj *retval = NULL; 
     64 
     65  switch( type ) 
     66    { 
     67    case T_FUNCTOR: 
     68      retval = crl_obj_class_dispatch_functor( ident, context, obj, 
     69                                               functor_call ); 
     70      break; 
     71 
     72    default: 
     73      crl_error("unhandled type!\n"); 
     74      break; 
     75    } 
     76 
     77  return retval; 
     78} 
  • src/rr_runtime.c

    rb2bc004 r89dcccd  
    10731073      if( o ) 
    10741074        { 
     1075          crl_assert( sym->op_a_t == TYPE_SYMBOL ); 
     1076          // dispatch the object __init__ function on construction! 
     1077          crl_symbol_obj *rr = crl_obj_class_dispatch_symbol( "__init__", context, T_FUNCTOR, 
     1078                                                              retval->op_a.object_state, 
     1079                                                              sym->op_a.symbol_table ); 
     1080          if( rr ) 
     1081            { 
     1082              if( rr->op_a_t != TYPE_SYMBOL_NIL ) 
     1083                { 
     1084                  crl_warning( "object <%s> __init__ did not return Nil!\n", 
     1085                               object_ident ); 
     1086                } 
     1087            } 
     1088          else 
     1089            { 
     1090              crl_fatal("error initilzing object <%s>!\n", object_ident ); 
     1091            } 
     1092 
     1093          // nothing to do with it... 
     1094          crl_garbage_mark_obj( &rr ); 
     1095 
    10751096          crl_symbol_init( retval ); 
    10761097          retval->type = SYMBOL_PRIMARY; 
     
    10781099          retval->op_a.object_state = crl_context_clone_obj_state( o ); 
    10791100 
    1080           // dispatch the object __init__ function on construction! 
    1081           crl_symbol_obj *rr = crl_obj_class_dispatch_symbol( "__init__", context, T_FUNCTOR, 
    1082                                                               retval->op_a.object_state ); 
    1083           if( rr->op_a_t != TYPE_SYMBOL_NIL ) 
    1084             { 
    1085               crl_warning( "object <%s> __init__ did not return Nil!\n", 
    1086                            object_ident ); 
    1087             } 
    1088           // nothing to do with it... 
    1089           crl_garbage_mark_obj( &rr ); 
    1090  
    1091            
     1101          // its now initilized! 
     1102          retval->op_a.object_state = CLASS_INIT; 
    10921103        } 
    10931104      else 
  • tools/crules.el

    r210169d r89dcccd  
    2323(define-generic-mode 'crules-mode 
    2424  '("#") 
    25   '("workflow" "class" "rule" "defun" "each" "break" "where" 
    26     "continue" "return" "in" "for" "while" "until" "import" 
    27     "from" "if" "elif" "else" "print" "true" "false" "eval" 
    28     "let" "null" "this" "at" "defre") 
     25  '("object" "defun" "break" "continue" 
     26    "return" "for" "while" "import" "if" 
     27    "elif" "else" "print" ) 
    2928  '(("[a-zA-Z_][a-zA-Z0-9_]+" . font-lock-variable-name-face) 
    30     ("[0-9]+" "true" "false" . font-lock-constant-face) 
     29    ("[0-9]+" "[0-9]+.[0-9]+"  
     30    "true" "false" "nil" . font-lock-constant-face) 
    3131    ("\\[.*\\]" . font-lock-type-face)) 
    3232  '(".crl\\'")