{
	"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
	"name": "Shadeup",
	"patterns": [
		{
			"include": "#comments"
		},
		{
			"include": "#preprocessor"
		},
		{
			"include": "#keywords"
		},
		{
			"include": "#strings"
		},
		{
			"comment": "Shader declarations",
			"begin": "^(\\bpixel|compute|vertex\\b)\\s+([A-Za-z0-9_]+)\\s*(\\([A-Za-z0-9<>_, ]*\\))\\s*",
			"beginCaptures": {
				"1": {
					"name": "keyword.shader.shadeup"
				},
				"2": {
					"name": "entity.name.function.shadeup"
				},
				"3": {
					"patterns": [
						{
							"include": "#function-arguments"
						}
					]
				}
			},
			"end": "(})",
			"patterns": [
				{
					"begin": "({)",
					"beginCaptures": {
						
					},
					"end": "(?=})",
					"patterns": [
						{
							"include": "source.hlsl"
						}
					]
				}
			]
		}
	],
	"repository": {
		"function-arguments": {
			"patterns": [
				{
					"include": "#function-argument"
				}
			]
		},
		"function-argument": {
			"patterns": [
				{
					"comment": "Args",
					"match": "\\b([A-Za-z0-9_<>]+)\\s+([A-Za-z0-9_]+)\\s*(?=,|\\))",
					"captures": {
						"1": {
							"patterns": [
								{
									"include": "#type"
								}
							]
						},
						"2": {
							"name": "entity.name.function.arguments.shadeup"
						}
					}
				}
			]
		},
		"keywords": {
			"patterns": [
				{
					"name": "keyword.control.shadeup",
					"match": "\\b(if|while|for|return)\\b"
				}
			]
		},
		"type": {
			"patterns": [
				{
					"name": "storage.type.shadeup",
					"match": "\\b(FVector3|FVector2|float|int|bool|float2|float3|float4|mat2|mat3|mat4|sampler2D|samplerCube)\\b"
				},
				{
					"name": "storage.type.shadeup",
					"match": "\\b([A-Za-z0-9_]+)(<[A-Za-z0-9_]+>)?\\b"
				}
			]
		},
		"preprocessor": {
			"patterns": [
				{
					"match": "(#[A-Za-z0-9_]+)\\s+(.*)",
					"captures": {
						"1": {
							"name": "keyword.preprocessor.shadeup"
						}
					}
				}
			]
		},
		"comments": {
			"patterns": [
				{
					"name": "comment.block.shadeup",
					"begin": "(\\/\\*)",
					"beginCaptures": {
						"1": {
							"name": "punctuation.definition.comment.shadeup"
						}
					},
					"end": "(\\*\\/)",
					"endCaptures": {
						"1": {
							"name": "punctuation.definition.comment.shadeup"
						}
					}
				},
				{
					"name": "comment.line.double-slash.shadeup",
					"begin": "(\\/\\/)",
					"beginCaptures": {
						"1": {
							"name": "punctuation.definition.comment.shadeup"
						}
					},
					"end": "(?:\\n|$)"
				}
			]
		},
		"strings": {
			"name": "string.quoted.double.shadeup",
			"begin": "\"",
			"end": "\"",
			"patterns": [
				{
					"name": "constant.character.escape.shadeup",
					"match": "\\\\."
				}
			]
		}
	},
	"scopeName": "source.shadeup"
}