示例#1
0
def create_tree_with_topological_ordering():
    return SyntaxTree(
        Node("ns").insert(
            Node("S0"),
            Node("A0").insert(
                Node("R0").insert(refs.TypeReference("ns.A1")),
                Node("R1").insert(refs.TypeReference("ns.S0"))), Node("A1")))
示例#2
0
def create_tree_with_type_refs():
    return SyntaxTree(
        Node("a").insert(
            Node("b").insert(Node("d"), refs.TypeReference("a.c.e")),
            Node("c").insert(Node("e"), refs.TypeReference("a.b.d"))))
示例#3
0
def create_tree_with_cycle():
    return SyntaxTree(
        Node("a").insert(
            Node("b").insert(Structure("c").insert(refs.TypeReference("a.d"))),
            Node("d").insert(refs.TypeReference("a.b"))))
示例#4
0
def test_reference_name_is_at_prefixed_and_at_separated():
    assert_equal("@foo@bar@baz", refs.TypeReference(name="foo.bar.baz").name)