1
0

unaryApp.js 323 B

123456789101112131415161718
  1. import {InfixApp} from './infixApp';
  2. export class UnaryApp extends InfixApp {
  3. constructor (op, left) {
  4. super(op, left, null);
  5. }
  6. toString () {
  7. const l = this.left.toString();
  8. const op = this.op.value;
  9. if(this.parenthesis) {
  10. return `(${op + l})`;
  11. } else {
  12. return op + l;
  13. }
  14. }
  15. }