parser tests
This commit is contained in:
parent
cda96d1864
commit
aa046aa45c
@ -18,3 +18,18 @@ class content:
|
||||
except Exception as e:
|
||||
print(" PARSING FAILED :\n", e)
|
||||
return markdown
|
||||
|
||||
# Parses a file & display its parse tree
|
||||
def test(filename):
|
||||
print(f"--- Parsing of {filename} ---\n")
|
||||
parsed = spipParser.parse(open(path.dirname(__file__) + "/" + filename).read())
|
||||
print(parsed, "\n")
|
||||
print(f"--- Parse tree of {filename} ---\n\n", parsed.pretty(), "\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Test
|
||||
test("../test/0.spip")
|
||||
test("../test/1.spip")
|
||||
test("../test/2.spip")
|
||||
test("../test/3.spip")
|
||||
test("../test/4.spip")
|
||||
|
Loading…
Reference in New Issue
Block a user