diff --git a/preproc/preproc/preprocessor.py b/preproc/preproc/preprocessor.py index 016439c810ed16dc92f7c241b22fe5cad3114de5..b79088c65b954697cf80336b06137822335f48df 100644 --- a/preproc/preproc/preprocessor.py +++ b/preproc/preproc/preprocessor.py @@ -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: