Changeset 22303 for v6

Show
Ignore:
Timestamp:
09/21/08 16:09:51 (2 months ago)
Author:
pmurias
Message:

[smop/pugs]
added .FETCH and .STORE to Code and constant identifiers
m0ld emitted by pugs uses FETCH

Location:
v6/smop
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/include/smop_s1p.h

    r22300 r22303  
    6363    SMOP__Object* invocant = SMOP__NATIVE__capture_invocant(interpreter, capture); \ 
    6464    assert(SMOP_RI(invocant) == (SMOP__ResponderInterface*)self) 
     65#define ___VALUE_FETCH___\ 
     66    ret = invocant; 
     67#define ___VALUE_STORE___ \ 
     68    { \ 
     69    fprintf(stderr, "can't call STORE or an read-only value at %s line %d file %s\n",__func__,__LINE__,__FILE__); \ 
     70    abort(); \ 
     71    }  
    6572 
    6673#define ___UNKNOWN_METHOD___ \ 
  • v6/smop/src/idconst.c

    r22017 r22303  
    5454} 
    5555 
    56 static SMOP__Object* idconst_message(SMOP__Object* stack, 
     56static SMOP__Object* idconst_message(SMOP__Object* interpreter, 
    5757                                     SMOP__ResponderInterface* self, 
    5858                                     SMOP__Object* identifier, 
    5959                                     SMOP__Object* capture) { 
    60   ___UNKNOWN_METHOD___; 
     60  ___NATIVE_CAPTURE_ONLY___; 
     61  ___CONST_IDENTIFIER_ONLY___; 
     62  ___INVOCANT_RI_SHOULD_MATCH___; 
     63 
     64  SMOP__Object* ret = SMOP__NATIVE__bool_false; 
     65 
     66  if (SMOP__ID__FETCH == identifier) { 
     67    ___VALUE_FETCH___; 
     68  } else if (SMOP__ID__STORE == identifier) { 
     69    ___VALUE_STORE___; 
     70  } else { 
     71    ___UNKNOWN_METHOD___; 
     72  } 
     73 
     74  SMOP_RELEASE(interpreter,invocant); 
     75  SMOP_RELEASE(interpreter,capture); 
     76  return ret; 
    6177} 
    6278 
  • v6/smop/src/smop_mold.c

    r22283 r22303  
    4242  int position; 
    4343  SMOP__Object* back; 
    44   SMOP__Object* ctx; 
    4544  SMOP__Object** registers; 
    4645  int target; 
     
    9392    ret->position = 0; 
    9493    ret->back = NULL; 
    95     ret->ctx = SMOP__NATIVE__bool_false; 
    9694    ret->registers = (SMOP__Object**) calloc(mold->registers,sizeof(SMOP__ResponderInterface));  
    9795    ret->target = 0; 
  • v6/smop/src/smop_s1p_code.sm0p

    r22282 r22303  
    9494    if (outer) SMOP_RELEASE(interpreter,outer); 
    9595 
     96  } else if (SMOP__ID__FETCH == identifier) { 
     97    ___VALUE_FETCH___; 
     98  } else if (SMOP__ID__STORE == identifier) { 
     99    ___VALUE_STORE___; 
    96100  } else { 
    97101    ___UNKNOWN_METHOD___; 
  • v6/smop/src/smop_s1p_io.ri

    r22274 r22303  
    22%RI.id lowlevel io 
    33%prefix smop_s1p_io 
    4 %include <stdlib.h>,<stdio.h> 
    54 
    65%{ 
  • v6/smop/tools/ri

    r22281 r22303  
    5858#include <smop_lowlevel.h> 
    5959#include <smop_s1p.h> 
     60#include <stdlib.h> 
     61#include <stdio.h> 
    6062]; 
    6163for (split (/,/,$properties{include} || '')) {