]> luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/flix.js
Initial commit.
[flow-web.git] / static / highlight / languages / flix.js
1 /*! `flix` grammar compiled for Highlight.js 11.11.1 */
2 (function(){
3 var hljsGrammar = (function () {
4 'use strict';
5
6 /*
7 Language: Flix
8 Category: functional
9 Author: Magnus Madsen <mmadsen@uwaterloo.ca>
10 Website: https://flix.dev/
11 */
12
13 /** @type LanguageFn */
14 function flix(hljs) {
15 const CHAR = {
16 className: 'string',
17 begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
18 };
19
20 const STRING = {
21 className: 'string',
22 variants: [
23 {
24 begin: '"',
25 end: '"'
26 }
27 ]
28 };
29
30 const NAME = {
31 className: 'title',
32 relevance: 0,
33 begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
34 };
35
36 const METHOD = {
37 className: 'function',
38 beginKeywords: 'def',
39 end: /[:={\[(\n;]/,
40 excludeEnd: true,
41 contains: [ NAME ]
42 };
43
44 return {
45 name: 'Flix',
46 keywords: {
47 keyword: [
48 "case",
49 "class",
50 "def",
51 "else",
52 "enum",
53 "if",
54 "impl",
55 "import",
56 "in",
57 "lat",
58 "rel",
59 "index",
60 "let",
61 "match",
62 "namespace",
63 "switch",
64 "type",
65 "yield",
66 "with"
67 ],
68 literal: [
69 "true",
70 "false"
71 ]
72 },
73 contains: [
74 hljs.C_LINE_COMMENT_MODE,
75 hljs.C_BLOCK_COMMENT_MODE,
76 CHAR,
77 STRING,
78 METHOD,
79 hljs.C_NUMBER_MODE
80 ]
81 };
82 }
83
84 return flix;
85
86 })();
87
88 hljs.registerLanguage('flix', hljsGrammar);
89 })();