Simplify abstract syntax further. Added OML exporter and test.

This commit is contained in:
Joeri Exelmans 2023-03-03 15:53:07 +01:00
parent a84f473feb
commit ea70d9278e
11 changed files with 155 additions and 29 deletions

17
tests/test_xopp2py.py Normal file
View file

@ -0,0 +1,17 @@
from xopp2py import parser, abstract_syntax
from xopp2py_oml import oml_writer
import os
DATADIR = os.path.join(os.path.dirname(__file__), "data")
class DummyOutput:
def write(self, text: str):
pass
def parse(filename):
asyntax = parser.parseFile(os.path.join(DATADIR, filename))
oml_writer.writeOML(asyntax, filename, "my_xopp", DummyOutput())
# Just see if these files parse without throwing an exception :)
parse("SmallXournalFile.xopp")
parse("TwoHiddenLayers.xopp")