@@ -258,25 +258,25 @@ const checkedNoun = new CheckedParser(
258
258
noun ,
259
259
) ;
260
260
function checkedSimpleUnitWith < T > (
261
- tag : Parser < unknown > ,
261
+ tag : string ,
262
262
after : Parser < T > ,
263
263
) : CheckedParser < readonly [ string , T ] > {
264
264
return checkedSequence (
265
- word . skip ( openParenthesis ) . skip ( tag ) ,
265
+ word . skip ( openParenthesis ) . skip ( keyword ( tag ) ) ,
266
266
closeParenthesis . with ( after ) ,
267
267
) ;
268
268
}
269
- function checkedSimpleUnit ( tag : Parser < unknown > ) : CheckedParser < string > {
269
+ function checkedSimpleUnit ( tag : string ) : CheckedParser < string > {
270
270
return checkedSimpleUnitWith ( tag , nothing ) . map ( ( [ word ] ) => word ) ;
271
271
}
272
272
function checkedSimpleUnitWithTemplate (
273
- tag : Parser < unknown > ,
273
+ tag : string ,
274
274
templateInside : Parser < unknown > ,
275
275
) : CheckedParser < string > {
276
276
return checkedSimpleUnitWith ( tag , template ( templateInside ) )
277
277
. map ( ( [ word ] ) => word ) ;
278
278
}
279
- const interjectionDefinition = checkedSimpleUnit ( keyword ( "i" ) )
279
+ const interjectionDefinition = checkedSimpleUnit ( "i" )
280
280
. map ( ( interjection ) => ( { type : "interjection" , interjection } ) as const ) ;
281
281
const particleDefinition = checkedSequence (
282
282
word . skip ( openParenthesis ) . skip ( keyword ( "particle" ) ) ,
@@ -285,14 +285,14 @@ const particleDefinition = checkedSequence(
285
285
. map ( ( [ definition ] ) =>
286
286
( { type : "particle definition" , definition } ) as const
287
287
) ;
288
- const adverbDefinition = checkedSimpleUnit ( keyword ( "adv" ) )
288
+ const adverbDefinition = checkedSimpleUnit ( "adv" )
289
289
. map ( ( adverb ) => ( { type : "adverb" , adverb } ) as const ) ;
290
290
const prepositionDefinition = checkedSimpleUnitWithTemplate (
291
- keyword ( "prep" ) ,
291
+ "prep" ,
292
292
sequence ( keyword ( "indirect" ) , keyword ( "object" ) ) ,
293
293
)
294
294
. map ( ( preposition ) => ( { type : "preposition" , preposition } ) as const ) ;
295
- const numeralDefinition = checkedSimpleUnit ( keyword ( "num" ) )
295
+ const numeralDefinition = checkedSimpleUnit ( "num" )
296
296
. mapWithPositionedError ( ( num ) => {
297
297
const numeral = Number . parseInt ( num ) ;
298
298
if ( Number . isNaN ( numeral ) ) {
@@ -397,7 +397,7 @@ const nounDefinition = new CheckedParser(
397
397
sequence (
398
398
noun ,
399
399
optionalWithCheck (
400
- checkedSimpleUnitWithTemplate ( keyword ( "prep" ) , keyword ( "headword" ) ) ,
400
+ checkedSimpleUnitWithTemplate ( "prep" , keyword ( "headword" ) ) ,
401
401
) ,
402
402
) ,
403
403
)
@@ -433,7 +433,7 @@ const verbDefinition = checkedSequence(
433
433
sequence ( closeParenthesis , openBracket , keyword ( "object" ) ) ,
434
434
closeBracket
435
435
. with ( optionalWithCheck (
436
- checkedSimpleUnitWith ( keyword ( "prep" ) , noun )
436
+ checkedSimpleUnitWith ( "prep" , noun )
437
437
. map ( ( [ preposition , object ] ) => ( { preposition, object } ) as const ) ,
438
438
) )
439
439
. map ( nullableAsArray ) ,
@@ -478,7 +478,7 @@ const verbDefinition = checkedSequence(
478
478
) ,
479
479
optionalWithCheck (
480
480
checkedSimpleUnitWith (
481
- keyword ( "prep" ) ,
481
+ "prep" ,
482
482
choiceWithCheck < "template" | Noun > (
483
483
checkedSequence (
484
484
openBracket ,
0 commit comments