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