I'll start off by stating that I am not a regex expert, so apologies if I'm looking at this incorrectly. There are several instances of regex used in this extension that I think need to be reviewed for correctness.
- I don't understand what purpose
(?=\S) serves in these instances. Can anyone clarify this for me?
- Instead of a negative lookahead, shouldn't this be using a negative lookbehind for the comment detection?
- IE
(?<!;~\s) instead of (?!;~\s)
- Removing the
\s from the end also makes it function better IMO
Anyone have thoughts or comments on this topic? Below are the two lines of code --
|
const findFunc = /(?=\S)(?!;~\s)Func\s+((\w+)\((.+)?\))/i; |
and
|
const includeFuncPattern = /(?=\S)(?!;~\s)Func\s+((\w+)\((.+)?\))/gi; |
I'll start off by stating that I am not a regex expert, so apologies if I'm looking at this incorrectly. There are several instances of regex used in this extension that I think need to be reviewed for correctness.
(?=\S)serves in these instances. Can anyone clarify this for me?(?<!;~\s)instead of(?!;~\s)\sfrom the end also makes it function better IMOAnyone have thoughts or comments on this topic? Below are the two lines of code --
AutoIt-VSCode/src/ai_commands.js
Line 915 in baac143
and
AutoIt-VSCode/src/util.js
Line 258 in baac143