Skip to content

Commit

Permalink
Fix regex to optionally ignore quoted strings (modelica#4183)
Browse files Browse the repository at this point in the history
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})
```
  • Loading branch information
beutlich committed Sep 5, 2023
1 parent 8c4e345 commit 76ec102
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .CI/check_deprecated_line_color.py
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 76ec102

Please sign in to comment.