code: func ParseRule(input string) (*Rule, error) {
  	stmts, _, err := ParseStatements("", input)
  	if err != nil {
  		return nil, err
  	}
  	if len(stmts) != 1 {
  		return nil, fmt.Errorf("expected exactly one statement (rule)")
  	}
  	rule, ok := stmts[0].(*Rule)
  	if !ok {
  		return nil, fmt.Errorf("expected rule but got %T", stmts[0])
  	}
  	return rule, nil
  }
docs: // ParseRule returns exactly one rule.
  // If multiple rules are parsed, an error is returned.