fix: report error for malformed else/elsif/endif/endfor, #713

This commit is contained in:
Harttle
2024-07-05 01:23:33 +08:00
parent d141c4bdd2
commit 22b5a12333
8 changed files with 41 additions and 47 deletions
+4
View File
@@ -8,3 +8,7 @@ export function assert <T> (predicate: T | null | undefined, message?: string |
throw new AssertionError(msg)
}
}
export function assertEmpty<T> (predicate: T | null | undefined, message = `unexpected ${JSON.stringify(predicate)}`) {
assert(!predicate, message)
}