mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
Mixing spaces and tabs, extra semicolons and lonely ifs are now forbidden
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user