Skip to content

Commit 674fd27

Browse files
authored
highlight config for C# (#276)
1 parent 2291d41 commit 674fd27

File tree

2 files changed

+115
-5
lines changed

2 files changed

+115
-5
lines changed

highlight/cs.v

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
module highlight
2+
3+
fn init_cs() Lang {
4+
return Lang{
5+
name: 'C#'
6+
lang_extensions: ['cs']
7+
line_comments: '//'
8+
mline_comments: ['/*', '*/']
9+
string_start: ['"', "'"]
10+
color: '#178600'
11+
keywords: [
12+
'abstract',
13+
'add',
14+
'alias',
15+
'async',
16+
'await',
17+
'base',
18+
'bool',
19+
'break',
20+
'by',
21+
'byte',
22+
'case',
23+
'catch',
24+
'char',
25+
'checked',
26+
'class',
27+
'const',
28+
'continue',
29+
'decimal',
30+
'default',
31+
'delegate',
32+
'do',
33+
'double',
34+
'else',
35+
'enum',
36+
'event',
37+
'explicit',
38+
'extern',
39+
'false',
40+
'finally',
41+
'fixed',
42+
'float',
43+
'for',
44+
'foreach',
45+
'from',
46+
'get',
47+
'goto',
48+
'group',
49+
'if',
50+
'implicit',
51+
'in',
52+
'int',
53+
'interface',
54+
'internal',
55+
'is',
56+
'join',
57+
'let',
58+
'lock',
59+
'long',
60+
'namespace',
61+
'new',
62+
'null',
63+
'object',
64+
'operator',
65+
'orderby',
66+
'out',
67+
'override',
68+
'params',
69+
'partial',
70+
'private',
71+
'protected',
72+
'public',
73+
'readonly',
74+
'ref',
75+
'remove',
76+
'return',
77+
'sbyte',
78+
'sealed',
79+
'select',
80+
'set',
81+
'short',
82+
'sizeof',
83+
'stackalloc',
84+
'static',
85+
'string',
86+
'struct',
87+
'switch',
88+
'this',
89+
'throw',
90+
'true',
91+
'try',
92+
'typeof',
93+
'uint',
94+
'ulong',
95+
'unchecked',
96+
'unsafe',
97+
'ushort',
98+
'using',
99+
'value',
100+
'var',
101+
'virtual',
102+
'void',
103+
'volatile',
104+
'where',
105+
'while',
106+
'yield',
107+
]
108+
}
109+
}

highlight/langs.v

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ pub fn extension_to_lang(ext string) !Lang {
3535
fn init_langs() []Lang {
3636
mut langs_ := []Lang{cap: 16}
3737
langs_ << init_c()
38-
langs_ << init_v()
39-
langs_ << init_js()
40-
langs_ << init_lua()
41-
langs_ << init_go()
4238
langs_ << init_cpp()
39+
langs_ << init_cs()
4340
langs_ << init_d()
41+
langs_ << init_go()
4442
langs_ << init_java()
43+
langs_ << init_js()
44+
langs_ << init_lua()
4545
langs_ << init_py()
46-
langs_ << init_ts()
4746
langs_ << init_rust()
47+
langs_ << init_ts()
48+
langs_ << init_v()
4849
return langs_
4950
}

0 commit comments

Comments
 (0)