Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getCodeFrame(source, line, column) {
var loc = {
start: {
line: line,
column: column
}
};
return "\n" + codeFrameFromSource(source, loc) + "\n";
}
function eatTokenOfType(type) {
if (token.type !== type) {
throw new Error("\n" + codeFrameFromSource(source, token.loc) + "Assertion error: expected token of type " + type + ", given " + tokenToString(token));
}
eatToken();
}
throw function () {
return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Could not determine global type" + ", given " + tokenToString(token));
}();
}
throw function () {
return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Function export expected a string" + ", given " + tokenToString(token));
}();
}
function getCodeFrame(source: string, line: number, column: number) {
const loc = {
start: { line, column }
};
return "\n" + codeFrameFromSource(source, loc) + "\n";
}
function eatTokenOfType(type) {
if (token.type !== type) {
throw new Error("\n" + codeFrameFromSource(source, token.loc) + "Assertion error: expected token of type " + type + ", given " + tokenToString(token));
}
eatToken();
}
throw function () {
return new Error("\n" + codeFrameFromSource(source, token.loc) + "\n" + "Unsupported global type, expected mut" + ", given " + tokenToString(token));
}();
}
function eatTokenOfType(type) {
if (token.type !== type) {
throw new Error("\n" + codeFrameFromSource(source, token.loc) + "Assertion error: expected token of type " + type + ", given " + tokenToString(token));
}
eatToken();
}
function eatTokenOfType(type: string) {
if (token.type !== type) {
throw new Error(
"\n" +
codeFrameFromSource(source, token.loc) +
"Assertion error: expected token of type " +
type +
", given " +
tokenToString(token)
);
}
eatToken();
}