summaryrefslogtreecommitdiff
path: root/script/lib/prism_osml.js
blob: 728ba9bc3ea7736ccf0c195072fa09017a063e5c (plain)
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
// @license magnet:?xt=urn:btih:5305d91886084f776adcf57509a648432709a7c7&dn=x11.txt
/*
 * Ousía Website JS
 *
 * (c) Andreas Stöckel, 2015
 *
 * This work is licensed under the X11 (MIT) license.
 * http://www.opensource.org/licenses/mit-license.php
 */

(function () {
"use strict";
Prism.languages.osml = {
	'comment': /%.*/,
	'keyword': /(\\begin|\\end|\\import)/,
	'function': /\\[a-zA-Z]([a-zA-Z0-9-_]*[a-zA-Z0-9])?/,
	'selector': /#[a-zA-Z]([a-zA-Z0-9-_]*[a-zA-Z0-9])?/,
	'attributes': {
		'pattern': /\[.*\]/,
		'inside': {
			'property': /[a-zA-Z]([a-zA-Z0-9-_]*[a-zA-Z0-9])?=/,
			'keyword': /(true|false|string|int|bool)/,
			'string': /("|')(\\\n|\\?.)*?\1/,
			'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/
		}
	},
	'reference': {
		'pattern': /::[^:]*::/,
		'inside': {
			'field': {
				'pattern': /{[^}]*}/,
				'inside': {
					'selector': /[a-zA-Z]([a-zA-Z0-9-_]*[a-zA-Z0-9])?/
				}
			}
		}
	}
};
})();

// @license-end