decl_context_tag

func decl_context_tag(context: &DeclContext) -> Int

Encodes a declaration context using the wrapper-service ABI tags 0 through 5.

Keep this mapping synchronized with parse_decl_tokens_in and decl_context_from_tag.

View Source
pub func decl_context_tag(context: &DeclContext) -> Int {
	match context {
		.top_level -> 0,
		.block -> 1,
		.struct_body -> 2,
		.enum_body -> 3,
		.protocol_body -> 4,
		.extend_body -> 5
	}
}