-
Notifications
You must be signed in to change notification settings - Fork 75
Fix switch regex to not match numeric values like -1 inside quoted strings #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
|
@copilot I'm getting the following errors now when I run included.h exists under the included directory too |
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
... Fixed in f1de702. The issue was that when The fix adds a |
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
parseCompilerArgs.batfails when parsing macro definitions containing numeric expressions like-D'LFS_ASSERT(test)'='do { if(!(test)) {return -1;} } while(0)'. The-1inside the quoted value was incorrectly matched as a compiler switch.Root Cause
The regex pattern
([a-zA-Z0-9_]+)inparseAnySwitchFromToolArgumentsmatches any alphanumeric sequence after-, including-1. This splits quoted strings at the wrong boundary.Fix
Require switch names to start with a letter:
This prevents numeric tokens like
-1,-2, etc. from being matched as switches while still matching valid switches like-D,-Wall,-std.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.