Commits

Andrew Godwin committed 2196ddd

More cleanup

Comments (0)

Files changed (1)

kugelblitz/translator/__init__.py

     except TypeError:
         raise CompileError("No translator available for %s." % node.__class__.__name__)
 
-def translate_body(body, line_separator='\n'):
-    s = []
-    for node in body:
-        if isinstance(node, ast.Pass):
-            continue
-        elif isinstance(node, ast.If):
-            s.append(translate(node))
-        else:
-            s.append('%s;' % translate(node))
-    return '\n'.join(s)
-
-def translate_function(node, instance_method=False):
-    """
-    Translates a function. If self_var is not none, it behaves as
-    an instance method.
-    """
-    # Generate argument definition
-    if instance_method:
-        args_def = ", ".join([arg.id for arg in node.args.args[1:]])
-        return "function (%(args_def)s) { %(body_def)s }" % {
-            "args_def": args_def,
-            "body_def": translate_body(node.body),
-        }
-    else:
-        args_def = ", ".join([arg.id for arg in node.args.args])
-        return "var %(name)s = function (%(args_def)s) { %(body_def)s }" % {
-            "args_def": args_def,
-            "body_def": translate_body(node.body),
-            "name": node.name,
-        }
-
 def translate_delete(node):
     return ';\n'.join('delete %s' % translate(n) for n in node.targets)
 
         "right": node.attr,
     }
 
-def translate_num(node):
-    return str(node.n)
-
 def translate_call(node):
     func = translate(node.func)
     if func == 'isinstance':
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.