{
	"scopeName": "tape_atom.injection",
	"injectionSelector": "L:source.c -comment -string, L:source.cpp -comment -string",
	"patterns": [
		{ "include": "#atom-declarations" },
		{ "include": "#component-declarations" },
		{ "include": "#annotation-arguments" },
		{ "include": "#annotations" },
		{ "include": "#delay-slots" },
		{ "include": "#types" },
		{ "include": "#attributes" }
	],
	"repository": {
		"atom-declarations": {
			"patterns": [
				{
					"match": "\\b(MipsAtom_)\\s*\\(\\s*([A-Za-z_][A-Za-z0-9_]*)",
					"captures": {
						"1": { "name": "keyword.control.duffle.atom" },
						"2": { "name": "entity.name.function.duffle.atom" }
					}
				},
				{ "match": "\\bMipsAtom_Proc_\\b", "name": "keyword.control.duffle.atom" },
				{ "match": "\\b[A-Za-z_][A-Za-z0-9_]*_proc\\b", "name": "entity.name.function.duffle.atom" }
			]
		},
		"component-declarations": {
			"patterns": [
				{
					"match": "\\b(MipsAtomComp_)\\s*\\(\\s*(ac_[A-Za-z0-9_]*)",
					"captures": {
						"1": { "name": "keyword" },
						"2": { "name": "entity.name.function.duffle.component" }
					}
				},
				{ "match": "\\bMipsAtomComp_Proc_\\b", "name": "keyword" }
			]
		},
		"annotation-arguments": {
			"patterns": [
				{
					"match": "\\b(atom_offset)\\s*\\(\\s*([A-Za-z_][A-Za-z0-9_]*)\\s*,\\s*([A-Za-z_][A-Za-z0-9_]*)",
					"captures": {
						"1": { "name": "support.function.duffle.annotation" },
						"2": { "name": "entity.name.label.duffle.atom" },
						"3": { "name": "entity.name.label.duffle.atom" }
					}
				},
				{ "match": "(?<=\\batom_bind\\()\\s*Binds_[A-Za-z0-9_]+", "name": "entity.name.type.duffle.bind" },
				{ "match": "(?<=\\batom_phase\\()\\s*[A-Za-z_][A-Za-z0-9_]*", "name": "entity.name.tag.duffle.phase" },
				{ "match": "(?<=\\batom_label\\()\\s*[A-Za-z_][A-Za-z0-9_]*", "name": "entity.name.label.duffle.atom" }
			]
		},
		"annotations": {
			"match": "\\b(atom_info|atom_bind|atom_reads|atom_writes|atom_label|atom_offset|atom_reg|atom_type|atom_ctx|atom_phase|atom_auto_reg|phase_auto_reg|atom_dbg_skip)\\b",
			"name": "support.function.duffle.annotation"
		},
		"delay-slots": {
			"match": "\\b(LdSlot_|BdSlot_)\\b",
			"name": "keyword.operator.duffle.delayslot"
		},
		"types": {
			"match": "\\b(?:Binds_[A-Za-z0-9_]+|RegUse_[A-Za-z0-9_]+)\\b",
			"name": "storage.type.duffle.type"
		},
		"attributes": {
			"match": "\\b(?:FI_|I_|NI_|Relative_|Struct_|Enum_|Union_|Array_|Slice_|TypeR_|TypeV_|align_|internal|local_persist|global|RO_|LP_|gknown|expect_|cexpr_|asm|asm_words|asm_rpins|asm_clobber|O_|S_|C_|T_|tmpl|glue|r_|v_|tr_|tv_|rgcc|r_use|r_set|r_mod|r_imm|r_mem|u[1248]_|u[1248]_r|u[1248]_v|s[1248]_)\\b",
			"name": "keyword"
		}
	}
}
