chore: Cleanup

This commit is contained in:
Sidharth Vinod
2022-09-08 21:38:06 +05:30
parent 64e72f67c9
commit 68626df061

View File

@@ -75,11 +75,12 @@ class PieParser extends EmbeddedActionsParser {
this.CONSUME(NewLine); this.CONSUME(NewLine);
}); });
this.OPTION2(() => { this.OPTION2(() => {
this.CONSUME2(AccDescription);
this.OR([ this.OR([
{ ALT: () => this.SUBRULE(this.accDescriptionSingleLine) }, { ALT: () => this.SUBRULE(this.accDescriptionSingleLine) },
{ ALT: () => this.SUBRULE(this.accDescriptionMultiLine) }, { ALT: () => this.SUBRULE(this.accDescriptionMultiLine) },
]); ]);
this.CONSUME2(NewLine); this.CONSUME3(NewLine);
}); });
this.AT_LEAST_ONE(() => { this.AT_LEAST_ONE(() => {
this.SUBRULE2(this.row); this.SUBRULE2(this.row);
@@ -112,14 +113,12 @@ class PieParser extends EmbeddedActionsParser {
}); });
public accDescriptionSingleLine = this.RULE('accDescriptionSingleLine', () => { public accDescriptionSingleLine = this.RULE('accDescriptionSingleLine', () => {
this.CONSUME(AccDescription);
this.CONSUME(Colon); this.CONSUME(Colon);
const accDescrText = this.CONSUME(Text).image; const accDescrText = this.CONSUME(Text).image;
this.ACTION(() => pieDb.setAccDescription(accDescrText)); this.ACTION(() => pieDb.setAccDescription(accDescrText));
}); });
public accDescriptionMultiLine = this.RULE('accDescriptionMultiLine', () => { public accDescriptionMultiLine = this.RULE('accDescriptionMultiLine', () => {
this.CONSUME(AccDescription);
this.CONSUME(LeftCurly); this.CONSUME(LeftCurly);
this.MANY(() => this.CONSUME(NewLine)); this.MANY(() => this.CONSUME(NewLine));