Commits

Waldemar Kornewald committed 20bb68e

fixed string escaping

  • Participants
  • Parent commits 5aa0bd4

Comments (0)

Files changed (2)

pyvascript/translator.ometa

 name      :n       -> self.name_map.get(n, n)
 number    :n       -> str(n)
 hexnumber :n       -> hex(n)
-string    :s       -> '"%s"' % s.encode('string_escape')
+string    :s       -> "'%s'" % s.encode('string_escape')
 
 new  expr:c                  -> 'new %s' % c
 
 
     def test_delete(self):
         self.check('del x[a]', 'delete x[a];')
-        self.check('del x["a"]', 'delete x["a"];')
+        self.check("del x['a']", "delete x['a'];")
         self.check('del x.a', 'delete x.a;')
 
     def test_getitem(self):
         }
         """, """
         x.prototype = {
-          "__init__": (function() {
+          '__init__': (function() {
             var a, nested, x;
             
             nested = function() {
             x = (a + 3);
             return x;
           }),
-          "add": (function(a, b, c) {
+          'add': (function(a, b, c) {
             return (1 + 2);
           })
         };