Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# What's New?

## 0.13

Improvements:

- Improve dryrun parsing to support single-quoted tool paths. mingw-make now working. [#739](https://github.com/microsoft/vscode-makefile-tools/issues/739)

## 0.12

Improvements:
Expand Down
14 changes: 7 additions & 7 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ async function parseLineAsTool(
// - with or without extension (windows only)
// - with or without quotes
// - must have at least one space or tab after the tool invocation
let regexpStr: string = '^[\\s\\"]*(.*?)(';
let regexpStr: string = "^[\\s\\\"\\']*(.*?)(";
if (process.platform === "win32") {
regexpStr += versionedToolNames.join("\\.exe|");

Expand All @@ -399,7 +399,7 @@ async function parseLineAsTool(
regexpStr += "|";
}

regexpStr += versionedToolNames.join("|") + ')(\\s|\\"\\s)(.*)$';
regexpStr += versionedToolNames.join("|") + ")(\\s|\\\"\\s|\\'\\s)(.*)$";

let regexp: RegExp = RegExp(regexpStr, "mg");
let match: RegExpExecArray | null = regexp.exec(line);
Expand Down Expand Up @@ -476,11 +476,11 @@ function findNextQuoteIndex(str: string, start: number, quote: string): number {
continue;
}

if (char === '\\') {
if (char === "\\") {
escaping = true;
continue;
}

if (char === quote) {
return index;
}
Expand Down Expand Up @@ -512,9 +512,9 @@ async function parseAnySwitchFromToolArguments(
// On Win32 allow '/' as switch prefix as well,
// otherwise it conflicts with path character
(process.platform === "win32" ? "|\\/)" : ")") +
"([a-zA-Z0-9_]+)" +
"([a-zA-Z0-9_]+)" +
// Try to match quoted value of argument
"(=(\"|\'))?";
"(=(\"|'))?";
let regexp: RegExp = RegExp(regExpStr, "mg");
let match1: RegExpExecArray | null;
let match2: RegExpExecArray | null;
Expand Down Expand Up @@ -572,7 +572,7 @@ async function parseAnySwitchFromToolArguments(
partialArgs = args.substring(index1, index2);
swi = match1[3];
swi = swi.trim();

// Skip over any switches that we know we don't need
let exclude: boolean = false;
for (const arg of excludeArgs) {
Expand Down