[pypy-svn] r42762 - in pypy/dist/pypy/lang/js: . test

santagada at codespeak.net santagada at codespeak.net
Sun May 6 22:59:06 CEST 2007


Author: santagada
Date: Sun May  6 22:59:06 2007
New Revision: 42762

Modified:
   pypy/dist/pypy/lang/js/jsobj.py
   pypy/dist/pypy/lang/js/newparser.py
   pypy/dist/pypy/lang/js/test/test_new_parser.py
Log:
make ++ work on new_parser and everywhere else also

Modified: pypy/dist/pypy/lang/js/jsobj.py
==============================================================================
--- pypy/dist/pypy/lang/js/jsobj.py	(original)
+++ pypy/dist/pypy/lang/js/jsobj.py	Sun May  6 22:59:06 2007
@@ -77,7 +77,7 @@
         raise NotImplementedError
     
     def PutValue(self, w, ctx):
-        raise NotImplementedError
+        pass
     
     def Call(self, ctx, args=[], this=None):
         raise NotImplementedError
@@ -427,7 +427,7 @@
             return r_uint(0)
            
         return r_uint(self.floatval)
-
+    
 class W_List(W_Root):
     def __init__(self, list_w):
         self.list_w = list_w

Modified: pypy/dist/pypy/lang/js/newparser.py
==============================================================================
--- pypy/dist/pypy/lang/js/newparser.py	(original)
+++ pypy/dist/pypy/lang/js/newparser.py	Sun May  6 22:59:06 2007
@@ -42,6 +42,7 @@
     UNOP_TO_CLS = {
         '+': operations.UPlus,
         '-': operations.UMinus,
+        '++': operations.Increment,
     }
     def get_instance(self, symbol, cls):
         assert isinstance(symbol, Symbol)
@@ -78,6 +79,7 @@
         result = self.get_instance(
                 op, self.UNOP_TO_CLS[op.additional_info])
         child = self.dispatch(node.children[1])
+        print child
         result.expr = child
         result.postfix = False
         return result

Modified: pypy/dist/pypy/lang/js/test/test_new_parser.py
==============================================================================
--- pypy/dist/pypy/lang/js/test/test_new_parser.py	(original)
+++ pypy/dist/pypy/lang/js/test/test_new_parser.py	Sun May  6 22:59:06 2007
@@ -298,3 +298,7 @@
         etree = self.to_etree('-(6 * (6 * 6)) + 6 - 6')
         w_num = etree.eval(None)
         assert w_num.ToNumber() == -216
+        etree = self.to_etree('++5')
+        w_num = etree.eval(None)
+        assert w_num.ToNumber() == 6
+    
\ No newline at end of file



More information about the Pypy-commit mailing list