@@ -417,19 +417,19 @@ const verbDefinition = checkedSequence(
417
417
) ,
418
418
choiceWithCheck < null | PartialVerb > (
419
419
checkedSequence (
420
- keyword ( "modal" ) ,
421
- sequence ( closeParenthesis , template ( keyword ( "predicate" ) ) ) ,
422
- )
423
- . map ( ( ) => null ) ,
424
- checkedSequence (
425
- keyword ( "linking" ) ,
426
- sequence ( closeParenthesis , template ( keyword ( "predicate" ) ) ) ,
420
+ sequence ( closeParenthesis , openBracket , keyword ( "object" ) ) ,
421
+ closeBracket
422
+ . with ( optionalWithCheck (
423
+ simpleDefinitionWith ( keyword ( "prep" ) , noun )
424
+ . map ( ( [ preposition , object ] ) => ( { preposition , object } ) as const ) ,
425
+ ) )
426
+ . map ( nullableAsArray ) ,
427
427
)
428
- . map ( ( ) => ( {
428
+ . map ( ( [ _ , indirectObject ] ) => ( {
429
429
directObject : null ,
430
- indirectObject : [ ] ,
431
- forObject : false ,
432
- predicateType : "noun adjective" ,
430
+ indirectObject,
431
+ forObject : true ,
432
+ predicateType : null ,
433
433
} ) ) ,
434
434
checkedSequence (
435
435
sequence ( closeParenthesis , openBracket , keyword ( "predicate" ) ) ,
@@ -442,19 +442,19 @@ const verbDefinition = checkedSequence(
442
442
predicateType : "verb" ,
443
443
} ) ) ,
444
444
checkedSequence (
445
- sequence ( closeParenthesis , openBracket , keyword ( "object" ) ) ,
446
- closeBracket
447
- . with ( optionalWithCheck (
448
- simpleDefinitionWith ( keyword ( "prep" ) , noun )
449
- . map ( ( [ preposition , object ] ) => ( { preposition, object } ) as const ) ,
450
- ) )
451
- . map ( nullableAsArray ) ,
445
+ keyword ( "modal" ) ,
446
+ sequence ( closeParenthesis , template ( keyword ( "predicate" ) ) ) ,
452
447
)
453
- . map ( ( [ _ , indirectObject ] ) => ( {
448
+ . map ( ( ) => null ) ,
449
+ checkedSequence (
450
+ keyword ( "linking" ) ,
451
+ sequence ( closeParenthesis , template ( keyword ( "predicate" ) ) ) ,
452
+ )
453
+ . map ( ( ) => ( {
454
454
directObject : null ,
455
- indirectObject,
456
- forObject : true ,
457
- predicateType : null ,
455
+ indirectObject : [ ] ,
456
+ forObject : false ,
457
+ predicateType : "noun adjective" ,
458
458
} ) ) ,
459
459
new CheckedParser (
460
460
nothing ,
@@ -554,22 +554,22 @@ const verbDefinition = checkedSequence(
554
554
}
555
555
} ) ;
556
556
const definition = choiceWithCheck < Definition > (
557
- interjectionDefinition ,
558
- particleDefinition ,
559
- prepositionDefinition ,
560
- numeralDefinition ,
561
- fillerDefinition ,
562
- fourFormPersonalPronounDefinition ,
563
- twoFormPersonalPronounDefinition ,
564
557
// noun parser must come before adjective, compound adjective, and determiner parsers
565
558
nounDefinition ,
566
559
// compound adjective parser must come before adjective parser
567
560
compoundAdjectiveDefinition ,
568
561
// adjective parser must come before adverb parser
569
562
adjective . map ( ( adjective ) => ( { ...adjective , type : "adjective" } ) ) ,
563
+ verbDefinition ,
570
564
adverbDefinition ,
565
+ interjectionDefinition ,
566
+ particleDefinition ,
571
567
determiner . map ( ( determiner ) => ( { ...determiner , type : "determiner" } ) ) ,
572
- verbDefinition ,
568
+ prepositionDefinition ,
569
+ numeralDefinition ,
570
+ fillerDefinition ,
571
+ twoFormPersonalPronounDefinition ,
572
+ fourFormPersonalPronounDefinition ,
573
573
) ;
574
574
const head = sequence ( all ( tokiPonaWord . skip ( comma ) ) , tokiPonaWord )
575
575
. skip ( colon )
0 commit comments