code: func (parser *Parser) parseAtRule() (*css.Rule, error) {
  	// parse rule name (eg: "@import")
  	token := parser.shiftToken()
  
  	result := css.NewRule(css.AtRule)
  	result.Name = token.Value
  
  	for parser.tokenParsable() {
  		if parser.tokenChar(";") {
  			parser.shiftToken()
  
  			// finished
  			break
  		} else if parser.tokenChar("{") {
  			if result.EmbedsRules() {
  				// parse rules block
  				rules, err := parser.ParseRules()
  				if err != nil {
  					return result, err
  				}
  
  				result.Rules = rules
  			} else {
  				// parse declarations block
  				declarations, err := parser.ParseDeclarations()
  				if err != nil {
  					return result, err
  				}
  
  				result.Declarations = declarations
  			}
  
  			// finished
  			break
  		} else {
  			// parse prelude
  			prelude, err := parser.parsePrelude()
  			if err != nil {
  				return result, err
  			}
  
  			result.Prelude = prelude
  		}
  	}
  
  	// log.Printf("[parsed] Rule: %s", result.String())
  
  	return result, parser.err()
  }
docs: // Parse an At Rule