Changeset 2304


Ignore:
Timestamp:
Feb 1, 2007, 3:29:12 AM (14 years ago)
Author:
orlov
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/rfp_as2as.rf

    r2202 r2304  
    1 // $Source$
    2 // $Revision$
    3 // $Date$
     1// $Id$
    42
    53$use "rfpc";
     
    2422
    2523// rename variables local for the {}-blocks
    26 //$func Rename-Vars s.num (e.upper-vars) (e.res-vars) e.Snt = e.new-Snt;
    27 $func Rename-Vars e = e;
     24$func Rename-Vars s.num (e.upper-vars) (e.res-vars) e.Snt = e.new-Snt;
    2825
    2926// is variable with e.QualifiedName in the e.vars list?
     
    296293        } :: (e.brv) e.bl-res-vars,
    297294        e.bl-res-vars : /*empty*/ =
    298         <Map &Rename-Vars <"+" s.num 1> (e.vars) (e.brv) (e.branches)>
     295        <Map &Rename-Vars <"+" s.num 2> (e.vars) (e.brv) (e.branches)>
    299296          :: e.branches,
    300         (e.vars) (e.new-Snt (s.block t.Pragma e.branches)) e.rest;
     297        {
     298          /*
     299           * If after block there is format then better rename format
     300           * variables -- inside the block those might clash with
     301           * already defined ones (see samples/Syntax/rename1.rf).
     302           */
     303          e.rest : (FORMAT e) e =
     304            () (e.new-Snt (s.block t.Pragma e.branches)
     305              <Rename-Vars <"+" s.num 1> (e.vars) (e.res-vars) e.rest>);
     306          (e.vars) (e.new-Snt (s.block t.Pragma e.branches)) e.rest;
     307        };
    301308      t.Statement : (BRANCH t.Pragma e.Sentence) =
    302309        () (e.new-Snt (BRANCH t.Pragma
Note: See TracChangeset for help on using the changeset viewer.