Changeset 4832 for src/Pugs/Bind.hs

Show
Ignore:
Timestamp:
06/19/05 07:28:00 (4 years ago)
Author:
chromatic
svk:copy_cache_prev:
6641
Message:

r4832@windwheel: chromatic | 2005-06-18 18:24:08 -0700
attribute fixing
r4835@windwheel: chromatic | 2005-06-18 22:12:48 -0700
Fix argument passing to object attributes in methods by attempting to bind

named values regardless of sigil and twigil.

r4836@windwheel: chromatic | 2005-06-18 22:14:04 -0700
Untodo some tests that now work.
Unfortunately, test 40 now fails (and I'm not what should go in :todo<???>).
r4837@windwheel: chromatic | 2005-06-18 22:15:47 -0700
Untodo several attribute-passing tests that now pass.
r4838@windwheel: chromatic | 2005-06-18 22:16:53 -0700
Fix a handful of typos and thinkos, and now this test completely passes!
r4839@windwheel: chromatic | 2005-06-18 22:17:40 -0700
Unskip the whole test file, fix the test number, untodo some passes, and clean

up the rest and all of this test file passes too.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Bind.hs

    r4158 r4832  
    3939    (bound, exps') = foldr doBind ([], []) (map unPair exps) 
    4040    doBind (name, exp) (bound, exps)  
    41         | Just prm <- find ((name ==) . tail . paramName) prms 
     41        | Just prm <- find ((matchNamedAttribute name) . paramName) prms 
    4242        = ( ((prm, exp) : bound), exps ) 
    4343        | otherwise 
    4444        = ( bound, (Syn "=>" [Val (VStr name), exp]:exps) ) 
    4545 
     46matchNamedAttribute :: String -> String -> Bool 
     47matchNamedAttribute arg (_:'.':param) = param == arg 
     48matchNamedAttribute arg (_:':':param) = param == arg 
     49matchNamedAttribute arg     (_:param) = param == arg 
     50matchNamedAttribute   _             _ = False 
     51 
    4652emptyHashExp :: Exp 
    4753emptyHashExp  = Val $ VList [] -- VHash $ vCast $ VList [] 
     54 
    4855emptyArrayExp :: Exp 
    4956emptyArrayExp = Val $ VList [] -- VArray $ vCast $ VList []