Skip to content

Commit

Permalink
Spoken form for zero ancestor
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Dec 13, 2023
1 parent f8acb3f commit 0b0ad9b
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ export class PrimitiveTargetSpokenFormGenerator {
throw new NoSpokenFormError(`Modifier '${modifier.type}'`);

case "containingScope":
if (modifier.ancestorIndex != null) {
if (modifier.ancestorIndex === 1) {
return [
this.spokenFormMap.modifierExtra.grandScope,
this.handleScopeType(modifier.scopeType),
];
}
throw new NoSpokenFormError(
`Modifier '${modifier.type}' with ancestor index != 1`,
);
if (modifier.ancestorIndex == null || modifier.ancestorIndex === 0) {
return this.handleScopeType(modifier.scopeType);
}
return [this.handleScopeType(modifier.scopeType)];
if (modifier.ancestorIndex === 1) {
return [
this.spokenFormMap.modifierExtra.grandScope,
this.handleScopeType(modifier.scopeType),
];
}
throw new NoSpokenFormError(
`Modifier '${modifier.type}' with ancestor index != 1`,
);

case "everyScope":
return [
Expand Down

0 comments on commit 0b0ad9b

Please sign in to comment.