Skip to content

Commit 397cff9

Browse files
authored
Merge pull request #21 from ukos-git/wrong_constant_parsing
Wrong constant parsing
2 parents 0638e45 + fc05e5a commit 397cff9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

procedures/CodeBrowser.ipf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ Function addDecoratedConstants(module, procedureWithoutModule, declWave, lineWav
341341

342342
// search code and return wavLineNumber
343343
Make/FREE/N=(numLines)/T text = StringFromList(p, procText, "\r")
344-
re = "^(?i)[[:space:]]*((?:override)?(?:static)?[[:space:]]*(?:Str)?Constant)[[:space:]]+(.*)=.*"
344+
// help for regex on https://regex101.com/
345+
re = "^(?i)[[:space:]]*((?:override\s+)?(?:static)?[[:space:]]*(?:Str)?Constant)[[:space:]]+([^=\s]*)\s*=\s*(?:\"(?:[^\"\\\\]|\\\\.)+\"|0[xX][0-9a-fA-F]+|[0-9]+)\s*(?:[\/]{2}.*)?"
345346
Grep/Q/INDX/E=re text
346347
Wave W_Index
347348
Duplicate/FREE W_Index wavLineNumber

0 commit comments

Comments
 (0)