Skip to content

Commit aba4a50

Browse files
committed
never type for token
also got rid of `NearleyToken` interface because it is no longer referenced with `never` for the type
1 parent 03f4d00 commit aba4a50

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/generate.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,11 @@
193193
output += parser.customTokens.map(function (token) { return "declare var " + token + ": any;\n" }).join("")
194194
output += parser.body.join('\n');
195195
output += "\n";
196-
output += "interface NearleyToken {\n";
197-
output += " value: any;\n";
198-
output += " [key: string]: any;\n";
199-
output += "};\n";
200-
output += "\n";
201196
output += "interface NearleyLexer {\n";
202197
output += " reset: (chunk: string, info: any) => void;\n";
203198
output += " next: () => NearleyToken | undefined;\n";
204199
output += " save: () => any;\n";
205-
output += " formatError: (token: NearleyToken) => string;\n";
200+
output += " formatError: (token: never) => string;\n";
206201
output += " has: (tokenType: string) => boolean;\n";
207202
output += "};\n";
208203
output += "\n";

0 commit comments

Comments
 (0)