Changeset 3949 for to-imperative


Ignore:
Timestamp:
Sep 19, 2008, 5:12:57 PM (12 years ago)
Author:
orlov
Message:
  • Fixed call of non-t-functions from t-functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/refal/org/refal/plus/compiler/rfp_asail_tpp.rf

    r3943 r3949  
    1212
    1313$box Current_Func;
     14$box Current_Func_Type;
     15$box Current_Func_Ress;
     16
     17$box FreeIdx;
    1418
    1519$box Current_Trace;
     
    170174    (TFUNC s.linkage t.name (e.args) (e.ress) e.body),
    171175      <Store &Current_Func t.name>,
     176      <Store &Current_Func_Type TFUNC>,
     177      <Store &Current_Func_Ress e.ress>,
     178      <Store &FreeIdx 0>,
    172179      { <Get &Entry> : e t.name e = <Store &Entry_Name <QName_To_Cpp <Concat t.name>>>;; },
    173180      {
     
    195202      s.tag : \{ FUNC; "FUNC?"; } =
    196203      <Store &Current_Func t.name>,
     204      <Store &Current_Func_Type s.tag>,
     205      <Store &FreeIdx 0>,
    197206      { <Get &Entry> : e t.name e = <Store &Entry_Name <QName_To_Cpp <Concat t.name>>>;; },
    198207      {
     
    369378//T/            <Args_To_CPP () Exprs e.exprs> ', ' <Args_To_CPP () Vars e.ress> ');');
    370379        <Concat <Intersperse (', ') <Replicate <Add <Length e.exprs> <Length e.ress>> ('TExpr&')>>> :: e.proto_args,
     380        () () () e.ress $iter {
     381          e.ress : (e.r) e.ress_rest, {
     382            # \{ <Lookup_Func t.name> : t TFUNC e; }, <Get &Current_Func_Ress> : e (e.r) e =
     383              <Get &FreeIdx> : s.idx,
     384              <Store &FreeIdx <Add s.idx 1>>,
     385              '_t_'s.idx :: e.tvar,
     386              (e.new_ress (e.tvar)) (e.decls ('TExpr 'e.tvar';')) (e.assigns (<Rfp2Cpp (e.r)>' = (Expr&)'e.tvar';')) e.ress_rest;
     387            (e.new_ress (<Rfp2Cpp (e.r)>)) (e.decls) (e.assigns) e.ress_rest;
     388          };
     389        } :: (e.new_ress) (e.decls) (e.assigns) e.ress,
     390        e.ress : /*empty*/ =
     391        e.decls
    371392        (<Name_To_CPP "DECL-FUNC" t.name CALL e.proto_args>'('
    372           <Concat <Intersperse (', ') (<Args_To_CPP () Exprs e.exprs>) <MapIn &Rfp2Cpp (<Paren e.ress>)>>>
    373         ');');
     393          <Concat <Intersperse (', ') (<Args_To_CPP () Exprs e.exprs>) e.new_ress>>
     394        ');')
     395        e.assigns;
    374396      };
    375397  } :: e.cpp_item,
Note: See TracChangeset for help on using the changeset viewer.