code: func schemaDefaultBodyRules(filename string, schema *configschema.Block, an *analysis, adhocComments *commentQueue) bodyContentRules {
  	ret := make(bodyContentRules)
  	if schema == nil {
  		// Shouldn't happen in any real case, but often crops up in tests
  		// where the mock schemas tend to be incomplete.
  		return ret
  	}
  
  	for name, attrS := range schema.Attributes {
  		if aty := attrS.Type; blocktoattr.TypeCanBeBlocks(aty) {
  			// Terraform's standard body processing rules for arbitrary schemas
  			// have a special case where list-of-object or set-of-object
  			// attributes can be specified as a sequence of nested blocks
  			// instead of a single list attribute. We prefer that form during
  			// upgrade for historical reasons, to avoid making large changes
  			// to existing configurations that were following documented idiom.
  			synthSchema := blocktoattr.SchemaForCtyContainerType(aty)
  			nestedRules := schemaDefaultBodyRules(filename, &synthSchema.Block, an, adhocComments)
  			ret[name] = nestedBlockRuleWithDynamic(filename, nestedRules, synthSchema, true, an, adhocComments)
  			continue
  		}
  		ret[name] = normalAttributeRule(filename, attrS.Type, an)
  	}
  	for name, blockS := range schema.BlockTypes {
  		nestedRules := schemaDefaultBodyRules(filename, &blockS.Block, an, adhocComments)
  		ret[name] = nestedBlockRuleWithDynamic(filename, nestedRules, blockS, false, an, adhocComments)
  	}
  
  	return ret
  }
docs: // schemaDefaultBodyRules constructs standard body content rules for the given
  // schema. Each call is guaranteed to produce a distinct object so that
  // callers can safely mutate the result in order to impose custom rules
  // in addition to or instead of those created by default, for situations
  // where schema-based and predefined items mix in a single body.