cdent.parser.pir.Parser

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

1 Examples 7

Example 1

Project: cdent-py Source File: test_parse_pir.py
    def test_parse_pir(self):
        parser = cdent.parser.pir.Parser()
        # parser.debug = True
        input = file('tests/modules/World.cd.pir', 'r').read()
        parser.open(input)
        try:
            ast = parser.parse()
        except cdent.parser.ParseError, err:
            print err
            return
            exit(1)

        parser = cdent.parser.cdent.yaml.Parser()
        input = file('tests/modules/World.cd.yaml', 'r').read()
        parser.open(input)
        expected = parser.parse()

        self.assertEqual(ast.__class__.__name__, expected.__class__.__name__)