Пример #1
0
 def test_variable_annotated_by_tree(self):
     scope = Scope()
     scope.declare("foo", Int, False)
     tree = SemanticParseTree(Variable(Int))
     tree.annotate(scope=scope)
     self.assertEqual(tree.string(), "foo")
Пример #2
0
 def test_variable_resolves_in_scope(self):
     scope = Scope()
     scope.declare("foo", Int, False)
     v = Variable(Int)
     v.annotate(scope, None)
     self.assertEqual(v.string(), "foo")