Changeset 6432 for src/Pugs/Compile.hs

Show
Ignore:
Timestamp:
08/23/05 23:42:59 (3 years ago)
Author:
iblech
Message:

* Pugs.AST.Scope: Reorder the declarations of the various scope types -- SLet

and STemp do something to *existing* variables. Accidentally, this causes
temp.t to pass on normal Pugs!

* Pugs.Lexer, Pugs.Compile: Acommodate for that change.
* PIL2JS: temp! let!

  • PIL: All JS functions have a block_leave_hooks array now, containing native JS functions to be called at block exit.
  • PIL::PPad uses this variable to implement the (possible) variable restoration needed for temp and let.

* t/var/let.t, t/var/temp.t: Should "temp @array[$index]" work? I think so, but

Pugs doesn't even parse that. Added appropriate tests in a =pod block.
BTW, let.t passes 7/7, temp.t passes 22/22 (with TODO tests).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Compile.hs

    r6424 r6432  
    142142    compile (Stmts (Pad SOur _ exp) rest) = do 
    143143        compile $ mergeStmts exp rest 
    144     compile (Stmts (Pad _ pad exp) rest) = do 
     144    compile (Stmts (Pad scope pad exp) rest) = do 
    145145        expC    <- compile $ mergeStmts exp rest 
    146146        padC    <- compile $ padToList pad 
    147         return $ PPad SMy ((map fst $ padToList pad) `zip` padC) expC 
     147        return $ PPad scope ((map fst $ padToList pad) `zip` padC) expC 
    148148    compile exp = compileStmts exp 
    149149