operand method

Node operand ()

An operand is anything that can be part of an operation.

operand is:

(-) dimension | color | variable | property | call

Implementation

Node operand() {
  String negate;
  Node o;

  if (parserInput.peek(_reOperand)) {
    negate = parserInput.$char('-');
  }

  o = sub() ??
      entities.dimension() ??
      entities.color() ??
      entities.variable() ??
      entities.property() ??
      entities.call() ??
      entities.quoted(forceEscaped: true) ??
      entities.colorKeyword() ??
      entities.mixinLookup();

  if (negate != null) {
    o.parensInOp = true;
    o = Negative(o);
  }

  return o;

// 3.5.0.beta.5 20180702
//  operand: function () {
//      var entities = this.entities, negate;
//
//      if (parserInput.peek(/^-[@\$\(]/)) {
//          negate = parserInput.$char('-');
//      }
//
//      var o = this.sub() || entities.dimension() ||
//              entities.color() || entities.variable() ||
//              entities.property() || entities.call() ||
//              entities.quoted(true) || entities.colorKeyword() ||
//              entities.mixinLookup();
//
//      if (negate) {
//          o.parensInOp = true;
//          o = new(tree.Negative)(o);
//      }
//
//      return o;
//  },
}