File: spirv.json.tmpl

package info (click to toggle)
spirv-tools 2026.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 28,900 kB
  • sloc: cpp: 477,281; javascript: 5,908; python: 3,326; ansic: 488; sh: 450; ruby: 88; makefile: 18; lisp: 9
file content (72 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download | duplicates (32)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
	"scopeName": "source.spirv",
	"name": "SPIR-V",
	"comment": "Generated by {{GenerateArguments}}. Do not modify this file directly.",
	"patterns": [
{{range $o := .All.OperandKinds}}{{if len $o.Enumerants}}		{ "include": "#{{$o.Category}}_{{$o.Kind}}" },
{{end}}{{end}}		{ "include": "#opcode" },
		{ "include": "#extopcode" },
		{ "include": "#identifier" },
		{ "include": "#number" },
		{ "include": "#string" },
		{ "include": "#comment" },
		{ "include": "#operator" }
	],
	"repository": { {{range $o := .All.OperandKinds}}{{if len $o.Enumerants}}
		"{{$o.Category}}_{{$o.Kind}}": {
			"match": "\\b({{OperandKindsMatch $o}})\\b",
			"name": "keyword.spirv"
		},{{end}}{{end}}
		"opcode": {
			"match": "(Op[a-zA-Z]+)",
			"name": "entity.name.function.spirv"
		},
		"extopcode": {
			"match": "({{AllExtOpcodes}})",
			"name": "entity.name.function.ext"
		},
		"identifier": {
			"match": "%[a-zA-Z0-9_]+",
			"name": "variable.spirv"
		},
		"number": {
			"match": "\\b[0-9]+.?[0-9]*\\b",
			"name": "constant.numeric.spirv"
		},
		"comment": {
			"match": ";[^\n]*",
			"name": "comment.line.spirv"
		},
		"operator": {
			"match": "=",
			"name": "keyword.operator.spirv"
		},
		"string": {
			"begin": "\"",
			"beginCaptures": {
				"0": {
					"name": "punctuation.definition.string.begin.spirv"
				}
			},
			"end": "\"",
			"endCaptures": {
				"0": {
					"name": "punctuation.definition.string.end.spirv"
				}
			},
			"name": "string.quoted.double.spirv",
			"patterns": [ { "include": "#string_escaped_char" } ]
		},
		"string_escaped_char": {
			"patterns": [
				{
					"match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",
					"name": "constant.character.escape.spirv"
				}, {
					"match": "\\\\[^0-7xuUabfnrtv\\'\"]",
					"name": "invalid.illegal.unknown-escape.spirv"
				}
			]
		}
	}
}