Open ylieder opened 3 years ago
As documented, the toString method of an expression surrounds every sub-expression with parentheses. For pretty printing, it would be good to have a pretty option in the toString method, putting only required parentheses.
toString
pretty
For example:
const exprString = Parser.parse('3 + ((4 - 5) * 12)').toString(); const exprStringPretty = Parser.parse('3 + ((4 - 5) * 12)').toString({pretty: true}); // exprString: (3 + ((4 - 5) * 12)) // exprStringPretty: 3 + (4 - 5) * 12
I would appreciate if is there any solution for this...
That would be great actually :+1:
As documented, the
toString
method of an expression surrounds every sub-expression with parentheses. For pretty printing, it would be good to have apretty
option in thetoString
method, putting only required parentheses.For example: