decl_context_from_tag

func decl_context_from_tag(tag: Int) -> DeclContext

Decodes the wrapper-service declaration-context ABI.

Tags 1 through 5 select block and nominal-body contexts; zero and unknown tags conservatively decode as top level.

View Source
pub func decl_context_from_tag(tag: Int) -> DeclContext {
	if tag == 1 { return .block }
	if tag == 2 { return .struct_body }
	if tag == 3 { return .enum_body }
	if tag == 4 { return .protocol_body }
	if tag == 5 { return .extend_body }
	.top_level
}