summaryrefslogtreecommitdiff
path: root/editors/html_syntax_highlighting/prism_sail.js
blob: 3300af6b7fbdfc5d5db4a039e8ce4c6e6e28f042 (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
Prism.languages.sail = {
      'comment': [
		{
			pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
			lookbehind: true
		},
		{
			pattern: /(^|[^\\:])\/\/.*/,
			lookbehind: true,
			greedy: true
		}
	],
      // Depending on the implementation, strings may allow escaped newlines and quote-escape
      'string': {
	  pattern: /(["])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
	  greedy: true
      },
      'operator': /:|->|==|!=|{\||\|}|=>|=|\+|-|@|\(\)|\(|\)|_|;|&|~|\.\.|,|\^|\*|\|/,
      'keyword': [
	  {
	      pattern: /(^|[^.])\b(type|union|register|function|clause|scattered|val|effect|end|true|false|let|if|then|else|match|as)\b/,
	      lookbehind: true
	  }
      ],
      'builtin': /\b[A-Z][A-Za-z_\-\/0-9']*/,
      'variable': /\b[a-z_][A-Za-z_\-\/0-9']*/,
      'function': /\b'[a-z_][A-Za-z_\-\/0-9']*/,
      'number': /\b0b\d+|\b\d+\.?\d*/,
      'punctuation': /[(){}\[\],:]/
};