Example #1
0
 def check_bad_tree(self, tree, label):
     try:
         parser.sequence2st(tree)
     except parser.ParserError:
         pass
     else:
         self.fail("did not detect invalid tree for %r" % label)
Example #2
0
    def roundtrip(self, f, s):
        st1 = f(s)
        t = st1.totuple()
        try:
            st2 = parser.sequence2st(t)
        except parser.ParserError:
            self.fail("could not roundtrip %r" % s)

        self.assertEquals(t, st2.totuple(),
                          "could not re-generate syntax tree")