From 8c0bf7d5d0aaf587f42e9a55d06a22a9ef713941 Mon Sep 17 00:00:00 2001 From: Thomas Beutlich Date: Wed, 16 Aug 2023 21:59:55 +0200 Subject: [PATCH] refs #4181 Fix regex to optionally ignore quoted strings Previously, a Text.lineColor annotation was not detected, if there was a closing parenthesis (within a quoted Text.textString annotation), e.g. ``` Text(extent={{-100,80},{-80,60}}, textString="1)", lineColor={0,0,255}) ``` --- .CI/check_deprecated_line_color.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.CI/check_deprecated_line_color.py b/.CI/check_deprecated_line_color.py index ef64d7c93fc..cf31b23460c 100644 --- a/.CI/check_deprecated_line_color.py +++ b/.CI/check_deprecated_line_color.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- ''' -Copyright (C) 2021, Modelica Association and contributors +Copyright (C) 2021-2023, Modelica Association and contributors All rights reserved. Check for deprecated Text.lineColor annotation @@ -13,7 +13,7 @@ import re import sys -PATTERN = re.compile(r'(Text\s*\([^\).]*)lineColor') +PATTERN = re.compile(r'(?:Text\s*\([^\)]*?(?:\"(?:\\.|[^\"])*\")?[^\)]*?)(lineColor)') def _checkDeprecatedFileLineColor(file_name): errors = 0