pypy / pypy / translator / jvm /

from pypy.translator.translator import graphof

# ___________________________________________________________________________

def with_types(type_list):
    def decorator(func):
        HELPERS[func] = type_list
        return func
    return decorator

def throwZeroDivisionError():
    raise ZeroDivisionError

def throwIndexError():
    raise IndexError

def throwOverflowError():
    raise OverflowError

def throwRuntimeError():
    raise RuntimeError

def throwMemoryError():
    raise MemoryError

def throwValueError():
    raise ValueError

def throwUnicodeDecodeError():
    raise UnicodeDecodeError

@with_types([str, str])
def recordStringString(a, b):
    return (a, b)

@with_types([float, float])
def recordFloatFloat(a, b):
    return (a, b)

@with_types([float, int])
def recordFloatSigned(a, b):
    return (a, b)

@with_types([int, int])
def recordSignedSigned(a, b):
    return (a, b)

# ___________________________________________________________________________

def create_interlink_node(db):
    """ Translates the create_interlink_impl() function and returns
    a jvm.Method object that allows it to be called. """
    translator = db.genoo.translator

    for func, type_list in HELPERS.items():
        translator.annotator.build_types(func, type_list) 

    helpers = {}
    for func in HELPERS.keys():
        graph = graphof(translator, func)
        helpers[func.func_name] = db.pending_function(graph)

    raise_OSError_graph = translator.rtyper.exceptiondata.fn_raise_OSError.graph
    helpers["throwOSError"] = db.pending_function(raise_OSError_graph)

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
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.