This commit is contained in:
weckyy702
2020-12-21 11:05:20 +01:00
parent 6587da8924
commit ff215f2207

View File

@@ -45,13 +45,13 @@ class NassiShneidermanDiagram:
def load_from_file(self, filepath: str): def load_from_file(self, filepath: str):
filtered_lines = self.load_code_lines(filepath) filtered_lines = self.load_code_lines(filepath)
scopes = [] global_scope = []
current_scope = scopes current_scope = global_scope
for line in filtered_lines: for line in filtered_lines:
logging.debug(line) logging.debug(line)
if line.__contains__('}'): if line.__contains__('}'):
current_scope.append("scope exit") current_scope.append("scope exit")
current_scope = scopes[-1] # does not get correct parent scope current_scope = global_scope[-1] # does not get correct parent scope
#TODO: get correct parent scope #TODO: get correct parent scope
if line.__contains__('{'): if line.__contains__('{'):
current_scope.append("scope enter") current_scope.append("scope enter")
@@ -60,7 +60,7 @@ class NassiShneidermanDiagram:
elif not line.__contains__('}'): elif not line.__contains__('}'):
current_scope.append("generic instruction") current_scope.append("generic instruction")
print(scopes) print(global_scope)