processFontFamily method

FontExpression processFontFamily()

Implementation

FontExpression processFontFamily() {
  var family = <String>[];

  // Possible family values:
  // * font-family: arial, Times new roman ,Lucida Sans Unicode,Courier;
  // * font-family: "Times New Roman", arial, Lucida Sans Unicode, Courier;
  var moreFamilies = false;

  for (; _index < _exprs.expressions.length; _index++) {
    var expr = _exprs.expressions[_index];
    if (expr is LiteralTerm) {
      if (family.isEmpty || moreFamilies) {
        // It's font-family now.
        family.add(expr.toString());
        moreFamilies = false;
      } else if (isChecked) {
        messages.warning('Only font-family can be a list', _exprs.span);
      }
    } else if (expr is OperatorComma && family.isNotEmpty) {
      moreFamilies = true;
    } else {
      break;
    }
  }

  return FontExpression(_exprs.span, family: family);
}