parser.sequence2st

Here are the examples of the python api parser.sequence2st taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

Example 1

Project: pyjs Source File: test_parser.py
Function: round_trip
    def roundtrip(self, f, s):
        st1 = f(s)
        t = st1.totuple()
        try:
            st2 = parser.sequence2st(t)
        except parser.ParserError, why:
            self.fail("could not roundtrip %r: %s" % (s, why))

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

Example 2

Project: pyjs Source File: test_parser.py
    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 3

Project: pymo Source File: test_parser.py
Function: round_trip
    def roundtrip(self, f, s):
        st1 = f(s)
        t = st1.totuple()
        try:
            st2 = parser.sequence2st(t)
        except parser.ParserError, why:
            self.fail("could not roundtrip %r: %s" % (s, why))

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

Example 4

Project: TrustRouter Source File: test_parser.py
Function: round_trip
    def roundtrip(self, f, s):
        st1 = f(s)
        t = st1.totuple()
        try:
            st2 = parser.sequence2st(t)
        except parser.ParserError as why:
            self.fail("could not roundtrip %r: %s" % (s, why))

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