{
	"copyright": [
		"Copyright AddOn Studio. All rights reserved"
	],
	"name": "pkgmeta file",
	"scopeName": "code.pkgmeta",
	"fileTypes": [
		"pkgmeta",
		"pkgmeta.yaml"
	],
	"patterns": [
		{ "include": "#comment" },
		{ "include": "#codeline" }
	],
	"repository": {
		"codeline": {
			"patterns": [
				{ "include": "#startend" },
				{ "include": "#namevalue" },
				{ "include": "#item" },
				{ "include": "#text" }
			]
		},
		"comment": {
			"patterns": [
				{
					"match": "^(?<!\\#)\\#(?!\\#).*",
					"name": "comment pkgmeta.comment"
				},
				{
					"match": "^(.+)( \\#.*)$",
					"name": "code.pkgmeta",
					"captures": {
						"1": { "patterns": [ { "include": "#codeline" } ] },
						"2": { "name": "comment pkgmeta.comment" }
					}
				}
			]
		},
		"text": {
			"patterns": [
				{
					"match": ".+",
					"name": "text pkgmeta.text"
				}
			]
		},
		"item": {
			"patterns": [
				{
					"match": "^([ ])*(-)\\s*(.+)?\\s*$",
					"name": "code pkgmeta.code",
					"captures": {
						"1": {
							"name": "keyword.preprocessor pkgmeta.pragma"
						},
						"2": {
							"name": "keyword.operator.assignment pkgmeta.operator"
						},
						"3": {
							"name": "constant.language pkgmeta.value",
							"patterns": [ { "include": "#literaltypes" } ]
						}
					}
				}
			]
		},
		"namevalue": {
			"patterns": [
				{
					"match": "^([ ])*([^:^\\s]+)\\s*(:)\\s*(.+)?\\s*$",
					"name": "source pkgmeta.source",
					"captures": {
						"1": {
							"name": "keyword.preprocessor pkgmeta.pragma"
						},
						"2": {
							"name": "entity.other.attribute-name"
						},
						"3": {
							"name": "keyword.operator.assignment pkgmeta.operator"
						},
						"4": {
							"name": "constant.language pkgmeta.value",
							"patterns": [
								{
									"name": "keyword.operator pkgmeta.operator",
									"match": "^([\\|\\>])\\s*$"
								},
								{ "include": "#literaltypes" }
							]
						}
					}
				}
			]
		},
		"startend": {
			"patterns": [
				{
					"match": "^---",
					"name": "entity.other.document.begin pkgdef.start"
				},
				{
					"match": "^\\.\\.\\.",
					"name": "entity.other.document.end pkgdef.end"
				}
			]
		},
		"literaltypes": {
			"patterns": [
				{ "include": "#datetime" },
				{
					"match": "\\b(true|false|nil)\\b",
					"name": "constant.language pkgmeta.literal"
				},
				{
					"match": "\\b([0-9]+\\.[0-9]+)\\b$",
					"name": "constant.numeric.floating-point pkgmeta.number"
				},
				{
					"match": "\\b([0-9]+)\\b$",
					"name": "constant.numeric.integer.nativeint pkgmeta.number"
				},
				{
					"match": "\"[^\"]*\"$",
					"name": "string.quoted.double pkgmeta.string"
				},
				{
					"match": "(?<![\\w])'[^']*'$",
					"name": "string.quoted.single pkgmeta.string"
				},
				{
					"match": ".+$",
					"name": "string.unquoted pkgmeta.string"
				}
			]
		},
		"datetime": {
			"patterns": [
				{
					"match": "\\b((\\d{4}/\\d{2}/\\d{2})|(\\d{2}/\\d{2}/\\d{4})|(\\d{2}/\\d{2}/\\d{2}))\\b",
					"name": "comment pkgmeta.date"
				},
				{
					"match": "\\b((\\d{4}-\\d{2}-\\d{2})|(\\d{2}-\\d{2}-\\d{4}))|(\\d{2}-\\d{2}-\\d{2})\\b",
					"name": "comment pkgmeta.date"
				}
			]
		},
		"literaltypestest": {
			"patterns": [
				{
					"match": "\\b\\d{2}\\:\\d{2} (AM|PM)\\b",
					"name": "comment toc.date"
				}
			]
		}

	}
}