masklinn avatar masklinn committed 7be96c3

[FIX] style issues: unused variables, missing semicolons, redundant declarations and implicit globals

Comments (0)

Files changed (1)

 var py = {};
 (function (py) {
-    var NUMBER = /^\d$/,
-        NAME_FIRST = /^[a-zA-Z_]$/,
-        NAME = /^[a-zA-Z0-9_]$/;
-
     var create = function (o, props) {
         function F() {}
         F.prototype = o;
 
         var Name = '[a-zA-Z_]\\w*';
 
-        var DecNumber = '\\d+'
+        var DecNumber = '\\d+';
         var IntNumber = DecNumber;
         var PointFloat = group('\\d+\\.\\d*', '\\.\\d+');
         var FloatNumber = PointFloat;
                              "//=?", "[+\\-*/%&|^=<>]=?", "~");
         var Bracket = '[\\[\\]\\(\\)\\{\\}]';
         var Special = '[:;.,`@]';
-        var Funny = group(Operator, Bracket, Special)
+        var Funny = group(Operator, Bracket, Special);
 
         var ContStr = group("'[^']*'", '"[^"]*"');
 
             tokens.push(create(symbols['(end)']));
             return tokens;
         }
-    })()
+    })();
 
     var token, next;
     function expression(rbp) {
             var res = constructor.apply(instance, arguments);
             // return result of constructor if any, otherwise instance
             return res || instance;
-        }
+        };
         return constructor;
-    }
+    };
 
     var hash_counter = 0;
     py.object = py.type(function object() {}, {}, {
             throw new Error(this.constructor.name + ' can not be converted to JSON');
         }
     });
-    NoneType = py.type(function NoneType() {}, py.object, {
+    var NoneType = py.type(function NoneType() {}, py.object, {
         __nonzero__: function () { return py.False; },
         toJSON: function () { return null; }
     });
     py.None = new NoneType();
-    NotImplementedType = py.type(function NotImplementedType(){});
+    var NotImplementedType = py.type(function NotImplementedType(){});
     py.NotImplemented = new NotImplementedType();
     var booleans_initialized = false;
     py.bool = py.type(function bool(value) {
         return expression();
     };
     var evaluate_operator = function (operator, a, b) {
+        var v;
         switch (operator) {
-        case '==': return a.__eq__(b)
+        case '==': return a.__eq__(b);
         case 'is': return a === b ? py.True : py.False;
-        case '!=': return a.__ne__(b)
+        case '!=': return a.__ne__(b);
         case 'is not': return a !== b ? py.True : py.False;
         case '<':
-            var v = a.__lt__(b);
+            v = a.__lt__(b);
             if (v !== py.NotImplemented) { return v; }
             return PY_ensurepy(a.constructor.name < b.constructor.name);
         case '<=':
-            var v = a.__le__(b);
+            v = a.__le__(b);
             if (v !== py.NotImplemented) { return v; }
             return PY_ensurepy(a.constructor.name <= b.constructor.name);
         case '>':
-            var v = a.__gt__(b);
+            v = a.__gt__(b);
             if (v !== py.NotImplemented) { return v; }
             return PY_ensurepy(a.constructor.name > b.constructor.name);
         case '>=':
-            var v = a.__ge__(b);
+            v = a.__ge__(b);
             if (v !== py.NotImplemented) { return v; }
             return PY_ensurepy(a.constructor.name >= b.constructor.name);
         case 'in':
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.