exprItem()

in lib/parser.js [1664:1728]


  exprItem() {
    if (this.look.tag === '!') {
      return this.notExpr();
    }

    if (this.look.tag === Tag.INCREMENT) {
      return this.increment();
    }

    if (this.look.tag === Tag.DECREMENT) {
      return this.decrement();
    }

    if (this.look.tag === Tag.STRING) {
      return this.string();
    }

    if (this.look.tag === Tag.NUMBER) {
      return this.number();
    }

    if (this.look.tag === Tag.BOOL) {
      return this.bool();
    }

    if (this.look.tag === Tag.NULL) {
      this.move();
      return {
        type: 'null'
      };
    }

    if (this.look.tag === Tag.NEW) {
      return this.construct();
    }

    if (this.look.tag === Tag.ID) {
      return this.idThings();
    }

    if (this.look.tag === Tag.VID) {
      return this.vidThings();
    }

    if (this.look.tag === '{') {
      return this.object();
    }

    if (this.look.tag === '[') {
      return this.array();
    }

    if (this.look.tag === '(') {
      return this.group();
    }

    if (this.look.tag === Tag.TEMPLATE) {
      return this.template();
    }

    if (this.look.tag === Tag.SUPER) {
      return this.superCall();
    }
    this.error('expect valid expression');
  }