Skip to content

Commit d93b51b

Browse files
committed
small refactor
1 parent aa2259c commit d93b51b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/parser/filter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,15 @@ export const CLAUSE_RULE: ReadonlyArray<(clause: Clause) => boolean> = [
279279
clause.explicitLi &&
280280
clause.subjects.type === "single"
281281
) {
282-
const { phrase } = clause.subjects;
282+
const { subjects: { phrase } } = clause;
283283
if (
284284
phrase.type === "default" &&
285285
phrase.headWord.type === "default" &&
286286
phrase.headWord.emphasis == null &&
287287
phrase.modifiers.length === 0 &&
288288
phrase.emphasis == null
289289
) {
290-
const { word } = phrase.headWord;
290+
const { headWord: { word } } = phrase;
291291
if (["mi", "sina"].includes(word)) {
292292
throw new UnrecognizedError(`"${word} li"`);
293293
}
@@ -303,7 +303,7 @@ export const SENTENCE_RULE: ReadonlyArray<(sentence: Sentence) => boolean> = [
303303
if (
304304
sentence.kinOrTaso != null && sentence.kinOrTaso.type === "x ala x"
305305
) {
306-
const { word } = sentence.kinOrTaso;
306+
const { kinOrTaso: { word } } = sentence;
307307
throw new UnrecognizedError(`"${word} ala ${word}"`);
308308
}
309309
}

src/translator/composer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function verb(phrase: English.VerbPhrase, depth: number): string {
8888
let text: string;
8989
switch (phrase.type) {
9090
case "default": {
91-
const { modal, verb } = phrase.verb;
91+
const { verb: { modal, verb } } = phrase;
9292
const verbText = !phrase.hideVerb
9393
? [
9494
...nullableAsArray(modal),

src/translator/sentence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function emphasisAsPunctuation(
6464
}
6565
function interjection(clause: TokiPona.Clause): ArrayResult<English.Clause> {
6666
if (clause.type === "phrases" && clause.phrases.type === "single") {
67-
const { phrase } = clause.phrases;
67+
const { phrases: { phrase } } = clause;
6868
if (phrase.type === "default" && phrase.modifiers.length === 0) {
6969
const { headWord } = phrase;
7070
switch (headWord.type) {

0 commit comments

Comments
 (0)