Mixing spaces and tabs, extra semicolons and lonely ifs are now forbidden

This commit is contained in:
BB
2022-03-11 16:32:48 +01:00
parent 372776c94e
commit 5e2ccc71ec
16 changed files with 47 additions and 85 deletions
+2 -6
View File
@@ -68,13 +68,11 @@ export function ParseCommand(command: string): (string | number | boolean)[] {
}
continue;
}
} else {
if (inQuote === ``) {
} else if (inQuote === ``) {
inQuote = `"`;
} else if (inQuote === `"`) {
inQuote = ``;
}
}
} else if (c === "'") {
// Single quotes, same thing as above
if (!escaped && prevChar === " ") {
@@ -88,13 +86,11 @@ export function ParseCommand(command: string): (string | number | boolean)[] {
}
continue;
}
} else {
if (inQuote === ``) {
} else if (inQuote === ``) {
inQuote = `'`;
} else if (inQuote === `'`) {
inQuote = ``;
}
}
} else if (c === " " && inQuote === ``) {
const arg = command.substr(start, i - start);