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:
2.0 KB
|
Line | |
---|
1 | /*
|
---|
2 | Language: F#
|
---|
3 | Author: Jonas Follesø <jonas@follesoe.no>
|
---|
4 | Contributors: Troy Kershaw <hello@troykershaw.com>, Henrik Feldt <henrik@haf.se>
|
---|
5 | Website: https://docs.microsoft.com/en-us/dotnet/fsharp/
|
---|
6 | Category: functional
|
---|
7 | */
|
---|
8 |
|
---|
9 | /** @type LanguageFn */
|
---|
10 | function fsharp(hljs) {
|
---|
11 | const TYPEPARAM = {
|
---|
12 | begin: '<',
|
---|
13 | end: '>',
|
---|
14 | contains: [
|
---|
15 | hljs.inherit(hljs.TITLE_MODE, {
|
---|
16 | begin: /'[a-zA-Z0-9_]+/
|
---|
17 | })
|
---|
18 | ]
|
---|
19 | };
|
---|
20 |
|
---|
21 | return {
|
---|
22 | name: 'F#',
|
---|
23 | aliases: ['fs'],
|
---|
24 | keywords:
|
---|
25 | 'abstract and as assert base begin class default delegate do done ' +
|
---|
26 | 'downcast downto elif else end exception extern false finally for ' +
|
---|
27 | 'fun function global if in inherit inline interface internal lazy let ' +
|
---|
28 | 'match member module mutable namespace new null of open or ' +
|
---|
29 | 'override private public rec return sig static struct then to ' +
|
---|
30 | 'true try type upcast use val void when while with yield',
|
---|
31 | illegal: /\/\*/,
|
---|
32 | contains: [
|
---|
33 | {
|
---|
34 | // monad builder keywords (matches before non-bang kws)
|
---|
35 | className: 'keyword',
|
---|
36 | begin: /\b(yield|return|let|do)!/
|
---|
37 | },
|
---|
38 | {
|
---|
39 | className: 'string',
|
---|
40 | begin: '@"',
|
---|
41 | end: '"',
|
---|
42 | contains: [
|
---|
43 | {
|
---|
44 | begin: '""'
|
---|
45 | }
|
---|
46 | ]
|
---|
47 | },
|
---|
48 | {
|
---|
49 | className: 'string',
|
---|
50 | begin: '"""',
|
---|
51 | end: '"""'
|
---|
52 | },
|
---|
53 | hljs.COMMENT('\\(\\*(\\s)', '\\*\\)', {
|
---|
54 | contains: ["self"]
|
---|
55 | }),
|
---|
56 | {
|
---|
57 | className: 'class',
|
---|
58 | beginKeywords: 'type',
|
---|
59 | end: '\\(|=|$',
|
---|
60 | excludeEnd: true,
|
---|
61 | contains: [
|
---|
62 | hljs.UNDERSCORE_TITLE_MODE,
|
---|
63 | TYPEPARAM
|
---|
64 | ]
|
---|
65 | },
|
---|
66 | {
|
---|
67 | className: 'meta',
|
---|
68 | begin: '\\[<',
|
---|
69 | end: '>\\]',
|
---|
70 | relevance: 10
|
---|
71 | },
|
---|
72 | {
|
---|
73 | className: 'symbol',
|
---|
74 | begin: '\\B(\'[A-Za-z])\\b',
|
---|
75 | contains: [hljs.BACKSLASH_ESCAPE]
|
---|
76 | },
|
---|
77 | hljs.C_LINE_COMMENT_MODE,
|
---|
78 | hljs.inherit(hljs.QUOTE_STRING_MODE, {
|
---|
79 | illegal: null
|
---|
80 | }),
|
---|
81 | hljs.C_NUMBER_MODE
|
---|
82 | ]
|
---|
83 | };
|
---|
84 | }
|
---|
85 |
|
---|
86 | module.exports = fsharp;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.