main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | /*
|
---|
| 2 | Language: Flix
|
---|
| 3 | Category: functional
|
---|
| 4 | Author: Magnus Madsen <mmadsen@uwaterloo.ca>
|
---|
| 5 | Website: https://flix.dev/
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | /** @type LanguageFn */
|
---|
| 9 | function flix(hljs) {
|
---|
| 10 | const CHAR = {
|
---|
| 11 | className: 'string',
|
---|
| 12 | begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
|
---|
| 13 | };
|
---|
| 14 |
|
---|
| 15 | const STRING = {
|
---|
| 16 | className: 'string',
|
---|
| 17 | variants: [{
|
---|
| 18 | begin: '"',
|
---|
| 19 | end: '"'
|
---|
| 20 | }]
|
---|
| 21 | };
|
---|
| 22 |
|
---|
| 23 | const NAME = {
|
---|
| 24 | className: 'title',
|
---|
| 25 | relevance: 0,
|
---|
| 26 | begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
|
---|
| 27 | };
|
---|
| 28 |
|
---|
| 29 | const METHOD = {
|
---|
| 30 | className: 'function',
|
---|
| 31 | beginKeywords: 'def',
|
---|
| 32 | end: /[:={\[(\n;]/,
|
---|
| 33 | excludeEnd: true,
|
---|
| 34 | contains: [NAME]
|
---|
| 35 | };
|
---|
| 36 |
|
---|
| 37 | return {
|
---|
| 38 | name: 'Flix',
|
---|
| 39 | keywords: {
|
---|
| 40 | literal: 'true false',
|
---|
| 41 | keyword: 'case class def else enum if impl import in lat rel index let match namespace switch type yield with'
|
---|
| 42 | },
|
---|
| 43 | contains: [
|
---|
| 44 | hljs.C_LINE_COMMENT_MODE,
|
---|
| 45 | hljs.C_BLOCK_COMMENT_MODE,
|
---|
| 46 | CHAR,
|
---|
| 47 | STRING,
|
---|
| 48 | METHOD,
|
---|
| 49 | hljs.C_NUMBER_MODE
|
---|
| 50 | ]
|
---|
| 51 | };
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | module.exports = flix;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.