Transpiled ES5 code to ES6/ES7

This commit is contained in:
Liyas Thomas
2020-06-11 19:55:40 +05:30
parent 9bc0ae975a
commit 0644a8c9fb
16 changed files with 108 additions and 123 deletions

View File

@@ -120,10 +120,10 @@ function expect(str) {
if (kind === "EOF") {
found = "[end of file]"
} else if (end - start > 1) {
found = "`" + string.slice(start, end) + "`"
found = `\`${string.slice(start, end)}\``
} else {
const match = string.slice(start).match(/^.+?\b/)
found = "`" + (match ? match[0] : string[start]) + "`"
found = `\`${match ? match[0] : string[start]}\``
}
throw syntaxError(`Expected ${str} but found ${found}.`)