Skip to content

Commit 6dcf72b

Browse files
authored
Fix regex to optionally ignore quoted strings when checking for deprecated Text.lineColor annotation (OpenIPSL#339)
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}) ```
1 parent 327e3a1 commit 6dcf72b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.CI/check_deprecated_line_color.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2021, Modelica Association and contributors
5+
Copyright (C) 2021-2023, Modelica Association and contributors
66
All rights reserved.
77
88
Check for deprecated Text.lineColor annotation
@@ -13,7 +13,7 @@
1313
import re
1414
import sys
1515

16-
PATTERN = re.compile(r'(Text\s*\([^\).]*)lineColor')
16+
PATTERN = re.compile(r'(?:Text\s*\([^\)]*?(?:\"(?:\\.|[^\"])*\")?[^\)]*?)(lineColor)')
1717

1818
def _checkDeprecatedFileLineColor(file_name):
1919
errors = 0

0 commit comments

Comments
 (0)