visitIfConfition()

in src/resolver/client.js [993:1018]


  visitIfConfition(stmtCondition) {
    let condition;
    if (stmtCondition.left) {
      let opt;
      let optList = ['and', 'or', 'not'];
      if (optList.indexOf(stmtCondition.type) > -1) {
        switch (stmtCondition.type) {
        case 'and': opt = Symbol.and(); break;
        case 'or': opt = Symbol.or(); break;
        case 'not': opt = Symbol.not(); break;
        }
        condition = new GrammerExpr(
          this.renderGrammerValue(null, stmtCondition.left),
          opt,
          this.renderGrammerValue(null, stmtCondition.right)
        );
      } else if (stmtCondition.type === 'call') {
        condition = this.renderGrammerValue(null, stmtCondition);
      } else {
        debug.stack(stmtCondition);
      }
    } else {
      condition = this.renderGrammerValue(null, stmtCondition);
    }
    return condition;
  }