Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use more efficient greedy quantifier in RE.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 Jan 2022 20:11:00 +0000 (21:11 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 Jan 2022 20:11:00 +0000 (21:11 +0100)
This is Sonar rule python:S6019
https://sonarcloud.io/organizations/simgrid/rules?open=python:S6019&rule_key=python:S6019

src/simix/simcalls.py

index 06b5b40..62358d0 100755 (executable)
@@ -192,7 +192,7 @@ def parse(fn):
         if line.startswith('#') or not line:
             continue
         match = re.match(
-            r'^(\S+)\s+([^\)\(\s]+)\s*\(*(.*)\)\s*(\[\[.*\]\])?\s*;\s*?$', line)
+            r'^(\S+)\s+([^\)\(\s]+)\s*\(*(.*)\)\s*(\[\[.*\]\])?\s*;\s*$', line)
         if not match:
             raise AssertionError(line)
         ret, name, args, attrs = match.groups()