From d92f91f22f4524a343527d1faa5ff9a672a4df96 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Fri, 5 Jan 2018 03:11:13 +0100 Subject: [PATCH] fix syntax errors --- il65/parse.py | 39 +++++++++++--------- il65/plyacc.py | 1 + il65/preprocess.py | 4 +- il65/symbols.py | 12 +++--- testsource/dtypes.ill | 6 +-- testsource/large.ill | 84 +++++++++++++++++++++--------------------- testsource/source2.ill | 19 +++++----- todo.ill | 4 +- 8 files changed, 88 insertions(+), 81 deletions(-) diff --git a/il65/parse.py b/il65/parse.py index a9c2174e0..cbb4157db 100644 --- a/il65/parse.py +++ b/il65/parse.py @@ -503,12 +503,9 @@ class Parser: if not line.startswith(("%import ", "%import\t")): raise self.PError("expected import") try: - _, arg = line.split(maxsplit=1) + _, filename = line.split(maxsplit=1) except ValueError: raise self.PError("invalid import statement") - if not arg.startswith('"') or not arg.endswith('"'): - raise self.PError("filename must be between quotes") - filename = arg[1:-1] if not filename: raise self.PError("invalid filename") self._parse_import_file(filename) @@ -678,25 +675,28 @@ class Parser: raise self.PError("ZP block cannot contain code statements") self.cur_block.statements.append(self.parse_statement(line)) elif line: - if is_zp_block: - raise self.PError("ZP block cannot contain code labels") - self.parse_label(line) + match = re.fullmatch(r"(?P