Beispiel #1
0
def ugdescr(x, recurse = None):
    v = descr(x, ugdescr)
    if isinstance(x, ast.ASTNode):
        if hasattr(x, "location"):
            return [{"$located"}] + list(v)
        else:
            return [{"!located"}] + list(v)
    else:
        return v
Beispiel #2
0
def ugdescr(x, recurse=None):
    v = descr(x, ugdescr)
    if isinstance(x, struct):
        if hastag(x, "location") and gettag(x, "location"):
            return [{"$located"}] + list(v)
        else:
            return [{"!located"}] + list(v)
    elif hasattr(x, "__libname__"):
        return [{"$lib"}, x.__libname__]
    elif isinstance(x, (type, FunctionType)):
        return [{"$lib"}, x.__name__]
    else:
        return v
Beispiel #3
0
def ugdescr(x, recurse = None):
    v = descr(x, ugdescr)
    if isinstance(x, struct):
        if hastag(x, "location") and gettag(x, "location"):
            return [{"$located"}] + list(v)
        else:
            return [{"!located"}] + list(v)
    elif hasattr(x, "__libname__"):
        return [{"$lib"}, x.__libname__]
    elif isinstance(x, (type, FunctionType)):
        return [{"$lib"}, x.__name__]
    else:
        return v