code: func (parser *Parser) ParseRules() ([]*css.Rule, error) {
  	result := []*css.Rule{}
  
  	inBlock := false
  	if parser.tokenChar("{") {
  		// parsing a block of rules
  		inBlock = true
  		parser.embedLevel++
  
  		parser.shiftToken()
  	}
  
  	for parser.tokenParsable() {
  		if parser.tokenIgnorable() {
  			parser.shiftToken()
  		} else if parser.tokenChar("}") {
  			if !inBlock {
  				errMsg := fmt.Sprintf("Unexpected } character: %s", parser.nextToken().String())
  				return result, errors.New(errMsg)
  			}
  
  			parser.shiftToken()
  			parser.embedLevel--
  
  			// finished
  			break
  		} else {
  			rule, err := parser.ParseRule()
  			if err != nil {
  				return result, err
  			}
  
  			rule.EmbedLevel = parser.embedLevel
  			result = append(result, rule)
  		}
  	}
  
  	return result, parser.err()
  }
docs: // ParseRules parses a list of rules