Skip to content

Commit

Permalink
never type for token
Browse files Browse the repository at this point in the history
also got rid of `NearleyToken` interface because it is no longer
referenced with `never` for the type
  • Loading branch information
bandaloo committed Nov 28, 2020
1 parent 03f4d00 commit aba4a50
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,11 @@
output += parser.customTokens.map(function (token) { return "declare var " + token + ": any;\n" }).join("")
output += parser.body.join('\n');
output += "\n";
output += "interface NearleyToken {\n";
output += " value: any;\n";
output += " [key: string]: any;\n";
output += "};\n";
output += "\n";
output += "interface NearleyLexer {\n";
output += " reset: (chunk: string, info: any) => void;\n";
output += " next: () => NearleyToken | undefined;\n";
output += " save: () => any;\n";
output += " formatError: (token: NearleyToken) => string;\n";
output += " formatError: (token: never) => string;\n";
output += " has: (tokenType: string) => boolean;\n";
output += "};\n";
output += "\n";
Expand Down

0 comments on commit aba4a50

Please sign in to comment.