Skip to content

Commit 18bd2de

Browse files
committed
remove unneeded generics
1 parent 46bc5d2 commit 18bd2de

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

dictionary/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ const verbDefinition = checkedSequence(
418418
)
419419
.skip(sequence(openParenthesis, keyword("v"))),
420420
),
421-
choiceWithCheck<null | PartialVerb>(
421+
choiceWithCheck(
422422
checkedSequence(
423423
sequence(closeParenthesis, openBracket, keyword("object")),
424424
closeBracket
@@ -549,7 +549,7 @@ const verbDefinition = checkedSequence(
549549
return { ...rest, type: "verb", presentPlural, presentSingular, past };
550550
}
551551
});
552-
const definition = choiceWithCheck<Definition>(
552+
const definition = choiceWithCheck(
553553
// noun parser must come before adjective, compound adjective, and determiner parsers
554554
nounDefinition,
555555
// compound adjective parser must come before adjective parser

src/parser/lexer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const combinedGlyphsToken = combinedGlyphs
187187
.map((words) => ({ type: "combined glyphs", words }));
188188
const wordToken = word.map((word) => ({ type: "word", word }));
189189

190-
export const token: Parser<Token> = choiceOnlyOne<Token>(
190+
export const token: Parser<Token> = choiceOnlyOne(
191191
xAlaX,
192192
multipleA,
193193
choice<Token>(longWord, wordToken),

src/parser/parser.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
MultipleSentences,
2424
Phrase,
2525
Predicate,
26-
Preposition,
2726
Sentence,
2827
SimpleHeadedWordUnit,
2928
} from "./ast.ts";
@@ -329,7 +328,7 @@ function nestedPhrasesOnly(
329328
phrases: phrases.map((phrase) => ({ type: "single", phrase })),
330329
}))
331330
: empty;
332-
return choice<MultiplePhrases>(
331+
return choice(
333332
longAnuParser,
334333
sequence(
335334
nestedPhrases(rest),
@@ -363,7 +362,7 @@ const subjectPhrases = choice(
363362
nestedPhrasesOnly(["anu", "en"]),
364363
singlePhrase,
365364
);
366-
const preposition = choice<Preposition>(
365+
const preposition = choice(
367366
specificToken("headless long glyph start")
368367
.with(phrase)
369368
.skip(specificToken("headless long glyph end"))

src/translator/clause.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function phraseClause(phrases: TokiPona.MultiplePhrases) {
2020
andParticle: "en",
2121
includeVerb: false,
2222
})
23-
.map<English.Clause>((phrase) => {
23+
.map((phrase) => {
2424
switch (phrase.type) {
2525
case "noun":
2626
return {

src/translator/phrase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ export function multiplePhrases(
375375
...phrases.phrases
376376
.map((phrases) => multiplePhrases({ ...options, phrases })),
377377
)
378-
.filterMap<null | PhraseTranslation>((phrase) => {
378+
.filterMap((phrase) => {
379379
if (
380380
phrase.some((phrase) =>
381381
phrase.type === "adjective" && phrase.inWayPhrase != null

0 commit comments

Comments
 (0)