Commit 99df6a0d authored by Johannes Bechberger's avatar Johannes Bechberger

Improve preprocessor and BitOps

parent 8ff97bdd
......@@ -21,8 +21,8 @@ class PreProcessor:
self.dst_file = dst_file
self.imported_strs = []
self._already_imported_classes = {} # name -> full_name
self._import_regexp = re.compile("import [A-Za-z.]+;")
self._imported_class_regexp = re.compile("[A-Za-z.]+;")
self._import_regexp = re.compile("import [A-Za-z.0-9]+;")
self._imported_class_regexp = re.compile("[A-Za-z.0-9]+;")
self._imported_classes = defaultdict(lambda: []) # name -> embedding files
if not os.path.isfile(src_file):
raise PreProcessorError("Source file '{}' isn't a file".format(src_file))
......@@ -127,7 +127,7 @@ def is_importable_file(file: str) -> bool:
if line.startswith("package "):
has_package = True
elif line.startswith("public class "):
match = re.search("[A-Za-z_]+", line.replace("public class ", ""))
match = re.search("[A-Za-z_0-9]+", line.replace("public class ", ""))
if match:
has_public_class = True
if match.group(0) != name:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment