From 153ede2edaa6bf7b11af8075257170257e999894 Mon Sep 17 00:00:00 2001 From: Jonas_Jones Date: Tue, 4 Mar 2025 19:40:12 +0100 Subject: [PATCH] added support for generic types "<" and ">" in the type reference are now recognised --- puml_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puml_generator.py b/puml_generator.py index 0335a00..a9d58bc 100644 --- a/puml_generator.py +++ b/puml_generator.py @@ -60,7 +60,7 @@ def is_line_field_declaration(line:str) -> bool: """ if "public" not in line and "private" not in line and "protected" not in line: return - field_pattern = re.compile(r'^\s*(public|private|protected|\s)*\s*(static|final|\s)*\s*(\w[\w\d]*)\s+(\w[\w\d]*)\s*(=\s*[^;]*)?;') + field_pattern = re.compile(r'^\s*(public|private|protected|\s)*\s*(static|final|\s)*\s*(\w[\w\d,<>\s]*)\s+(\w[\w\d]*)\s*(=\s*[^;]*)?;') match = field_pattern.match(line.strip()) return match is not None @@ -69,7 +69,7 @@ def get_field_visibility(line): """ Checks if the line is a field declaration and returns its visibility (+, -, or #). """ - field_pattern = re.compile(r'^\s*(public|private|protected|\s)*\s*(static|final|\s)*\s*(\w[\w\d]*)\s+(\w[\w\d]*)\s*(=\s*[^;]*)?;') + field_pattern = re.compile(r'^\s*(public|private|protected|\s)*\s*(static|final|\s)*\s*(\w[\w\d,<>\s]*)\s+(\w[\w\d]*)\s*(=\s*[^;]*)?;') match = field_pattern.match(line.strip()) if match: # Check for the access modifier in the line and return the corresponding symbol