Skip to content

Commit 220bc40

Browse files
C#: Added char token (#3270)
1 parent 8476a9a commit 220bc40

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

components/prism-csharp.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@
9797
pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
9898
lookbehind: true,
9999
greedy: true
100-
},
101-
{
102-
pattern: RegExp(character),
103-
greedy: true,
104-
alias: 'character'
105100
}
106101
],
107102
'class-name': [
@@ -359,7 +354,11 @@
359354
greedy: true,
360355
inside: createInterpolationInside(sInterpolation, sInterpolationRound),
361356
}
362-
]
357+
],
358+
'char': {
359+
pattern: RegExp(character),
360+
greedy: true
361+
}
363362
});
364363

365364
Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;

components/prism-csharp.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'a'
2+
'\''
3+
'\\'
4+
5+
----------------------------------------------------
6+
7+
[
8+
["char", "'a'"],
9+
["char", "'\\''"],
10+
["char", "'\\\\'"]
11+
]

tests/languages/csharp/string_feature.test

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
@"foo
88
bar"
99

10-
'a'
11-
'\''
12-
'\\'
13-
1410
----------------------------------------------------
1511

1612
[
@@ -20,13 +16,9 @@ bar"
2016
["string", "@\"\""],
2117
["string", "@\"foo\""],
2218
["string", "@\"fo\"\"o\""],
23-
["string", "@\"foo\r\nbar\""],
24-
["string", "'a'"],
25-
["string", "'\\''"],
26-
["string", "'\\\\'"]
19+
["string", "@\"foo\r\nbar\""]
2720
]
2821

2922
----------------------------------------------------
3023

3124
Checks for normal and verbatim strings.
32-
Also checks for single quoted characters.

0 commit comments

Comments
 (0)