예제 #1
0
파일: shortcuts.py 프로젝트: numerodix/luna
def parse(filepath):
    import os
    content = filepath
    if os.path.isfile(filepath):
        content = util.read(filepath)
    parser = Parser()
    return parser.parse_with_rule(None, content)
예제 #2
0
파일: parser.py 프로젝트: y372465774/luna
    def __init__(self):
        dir = os.path.dirname(os.path.abspath(__file__))
        fp = os.path.join(dir, 'grammar.txt')
        content = util.read(fp)

        self.grammar = Grammar(content)
        self.builder = AstBuilder()
예제 #3
0
def parse(filepath):
    import os
    content = filepath
    if os.path.isfile(filepath):
        content = util.read(filepath)
    parser = Parser()
    return parser.parse_with_rule(None, content)
예제 #4
0
 def do(filepath):
     base = join(dirname(dirname(__file__)), 'programs')
     fp = join(base, filepath)
     content = util.read(fp)
     return content
예제 #5
0
파일: conftest.py 프로젝트: numerodix/luna
 def do(filepath):
     base = join(dirname(dirname(__file__)), 'programs')
     fp = join(base, filepath)
     content = util.read(fp)
     return content