processDeclarations method

List processDeclarations({
  1. bool checkBrace = true,
})

Implementation

List<dynamic> processDeclarations({bool checkBrace = true}) {
  if (checkBrace) _eat(TokenKind.LBRACE);

  var declaration = CSSStyleDeclaration();
  List list = [declaration];
  do {
    var selectorGroup = _nestedSelector();
    while (selectorGroup != null) {
      // Nested selector so process as a ruleset.
      List<CSSRule> rule = processRule(selectorGroup)!;
      list.addAll(rule);
      selectorGroup = _nestedSelector();
    }
    processDeclaration(declaration);
  } while (_maybeEat(TokenKind.SEMICOLON));

  if (checkBrace) _eat(TokenKind.RBRACE);
  return list;
}