This commit is contained in:
oleting committed 2020-12-27 20:31:48 +01:00
commit 7552c31ccf
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
class InterpreterError(Exception): class InterpreterException(Exception):
pass pass
class JavaSyntaxError(Exception): class JavaSyntaxError(Exception):
+1 -1
View File
@@ -29,7 +29,7 @@ class NassiShneidermanDiagram:
h += inst.getblksize() h += inst.getblksize()
return int(h) return int(h)
def convert_to_image(self, filepath, filename: str, x_size: int=200): def convert_to_image(self, filepath: str, filename: str, x_size: int=200):
image_y_sz = self._get_image_height() image_y_sz = self._get_image_height()
logging.info(f"Saving NSD to {filename}.png...") logging.info(f"Saving NSD to {filename}.png...")
with NSD_writer(filepath, filename, x_size, image_y_sz): with NSD_writer(filepath, filename, x_size, image_y_sz):
+2 -2
View File
@@ -3,7 +3,7 @@ from os import remove
import re import re
from typing import Callable, List, Tuple from typing import Callable, List, Tuple
from errors.custom import InterpreterError, JavaSyntaxError, ScopeNotFoundException from errors.custom import InterpreterException, JavaSyntaxError, ScopeNotFoundException
from draw.Iinstruction import * from draw.Iinstruction import *
COMMENT_REGEX = r"""^//|^#|^COMMENT|^--""" COMMENT_REGEX = r"""^//|^#|^COMMENT|^--"""
@@ -163,5 +163,5 @@ def load_instructions(filepath: str) -> List[Iinstruction]:
src = load_src(filepath) src = load_src(filepath)
instructions, i = get_instructions_in_scope(src) instructions, i = get_instructions_in_scope(src)
if i != len(src): if i != len(src):
raise InterpreterError("Unknown error during source interpretation! Unsupported language constructs or ill-formed source?") raise InterpreterException("Unknown error during source interpretation! Unsupported language constructs or ill-formed source?")
return instructions return instructions