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