mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
Use error log level, prefix messages
This commit is contained in:
@@ -67,7 +67,7 @@ function compileConfig(config: string): AdvancedSkipRule[] | null {
|
||||
const { rules, errors } = parseConfig(config);
|
||||
|
||||
for (const error of errors) {
|
||||
console.log(`Error on line ${error.span.start.line}: ${error.message}`);
|
||||
console.error(`[SB] Error on line ${error.span.start.line}: ${error.message}`);
|
||||
}
|
||||
|
||||
if (errors.length === 0) {
|
||||
|
||||
@@ -737,11 +737,9 @@ export function parseConfig(config: string): { rules: AdvancedSkipRule[]; errors
|
||||
}
|
||||
|
||||
expect(["if"], rule.comments.length !== 0 ? "expected `if` after `comment`" : "expected `if`", true);
|
||||
|
||||
rule.predicate = parsePredicate();
|
||||
|
||||
expect(["disabled", "show overlay", "manual skip", "auto skip"], "expected skip option after predicate", true);
|
||||
|
||||
expect(["disabled", "show overlay", "manual skip", "auto skip"], "expected skip option after condition", true);
|
||||
switch (previous.type) {
|
||||
case "disabled":
|
||||
rule.skipOption = CategorySkipOption.Disabled;
|
||||
@@ -801,7 +799,7 @@ export function parseConfig(config: string): { rules: AdvancedSkipRule[]; errors
|
||||
function parsePrimary(): AdvancedSkipPredicate {
|
||||
if (match(["("])) {
|
||||
const predicate = parsePredicate();
|
||||
expect([")"], "expected `)` after predicate", true);
|
||||
expect([")"], "expected `)` after condition", true);
|
||||
return predicate;
|
||||
} else {
|
||||
return parseCheck();
|
||||
|
||||
Reference in New Issue
Block a user