Commits

masklinn committed 1a0e610

[FIX] correctly parse long integers (?)

  • Participants
  • Parent commits 6bcdcb6

Comments (0)

Files changed (2)

 
         var Name = '[a-zA-Z_]\\w*';
 
-        var DecNumber = '\\d+';
+        var DecNumber = '\\d+(L|l)?';
         var IntNumber = DecNumber;
         var PointFloat = group('\\d+\\.\\d*', '\\.\\d+');
         var FloatNumber = PointFloat;

File test/builtins/float.js

             expect(py.eval('.42')).to.be(0.42);
             expect(py.eval('1.2')).to.be(1.2);
         });
+        it('should also parse longs as floats', function () {
+            expect(py.eval('(1L)')).to.be(1);
+            expect(py.eval('42L')).to.be(42);
+            expect(py.eval('9999L')).to.be(9999);
+        });
     });
     it('should roundrip', function () {
         expect(py.float.fromJSON(2.42).toJSON())