Changeset 22930 for v6

Show
Ignore:
Timestamp:
11/08/08 12:45:32 (2 months ago)
Author:
pmurias
Message:

[smop] hello wold works with m0ld --exec again
it is a problem with BValues
added BValue.DEBUG and smop_describe_object to help debugging

Location:
v6/smop
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • v6/smop/m0ld/M0ld/Eval.hs

    r22642 r22930  
    2828foreign import ccall "smop_haskell_ffi.h smop_ri" 
    2929      c_smop_ri :: SMOP__Object -> SMOP__Object 
     30foreign import ccall "smop_haskell_ffi.h smop_describe_object" 
     31      c_smop_describe_object :: SMOP__Object -> IO () 
     32 
     33describe_object obj = do  
     34    ptr <- smopify obj 
     35    c_smop_describe_object ptr 
    3036 
    3137foreign import ccall "smop_native.h SMOP__NATIVE__idconst_createn" 
     
    128134    root <- rootnamespace 
    129135 
    130     out_scalar <- call root "postcircumfix:{ }" ["$*OUT"] none 
     136    -- describe_object root 
     137 
     138    -- out_scalar <- call root "postcircumfix:{ }" ["$*OUT"] none 
     139    out_scalar <- call root "lookup_key" ["$*OUT"] none 
     140 
     141    -- describe_object out_scalar 
     142 
     143    --call out_scalar "DEBUG" none none 
     144 
    131145    out <- call out_scalar "FETCH" none none 
    132146 
    133     mold_frame_scalar <- call root "postcircumfix:{ }" ["::MoldFrame"] none 
     147    -- describe_object out 
     148 
     149    mold_frame_scalar <- call root "lookup_key" ["::MoldFrame"] none 
    134150    mold_frame <- call mold_frame_scalar "FETCH" none none 
    135151 
  • v6/smop/m0ld/m0ld.cabal

    r22641 r22930  
    1212    description: Enable SMOP Embedding 
    1313    default:     False 
    14 library 
     14-- library 
     15--    build-Depends:       base,utf8-string >= 0.3.1.1,containers >= 0.1.0.1,parsec >= 2.0.0.0 
     16-- 
     17--    exposed-modules:     M0ld,M0ld.Parser,M0ld.AST -} 
     18executable m0ld 
    1519    build-Depends:       base,utf8-string >= 0.3.1.1,containers >= 0.1.0.1,parsec >= 2.0.0.0 
    16  
    17     exposed-modules:     M0ld,M0ld.Parser,M0ld.AST 
    18 executable m0ld 
    1920    main-is:            m0ld.hs 
    2021    if flag(SMOP) 
  • v6/smop/src/haskell_ffi.c

    r22645 r22930  
    2525  return SMOP__S1P__RootNamespace; 
    2626} 
     27void smop_describe_object(SMOP__Object* obj) { 
     28  printf("RI: %s\n",SMOP_RI(obj)->id); 
     29} 
    2730SMOP__Object* smop_get_cvar(char* var) { 
    2831  //printf("fetching \"%s\"\n",var); 
  • v6/smop/src/s1p_hash_bvalue.ri

    r22736 r22930  
    6868                  SMOP__ID__goto, 
    6969                  frame); 
     70%method DEBUG 
     71   int identifier_size; 
     72   SMOP__Object* key = ((smop_s1p_hash_bvalue_struct*)invocant)->key; 
     73   char* s = SMOP__NATIVE__idconst_fetch(key,&identifier_size); 
     74   printf("BValue.DEBUG key='%.*s'\n",identifier_size,s);  
    7075 
    7176%mold bind_mold