Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
C#: Added char token (#3270)
  • Loading branch information
RunDevelopment committed Dec 5, 2021
1 parent 8476a9a commit 220bc40
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
11 changes: 5 additions & 6 deletions components/prism-csharp.js
Expand Up @@ -97,11 +97,6 @@
pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
lookbehind: true,
greedy: true
},
{
pattern: RegExp(character),
greedy: true,
alias: 'character'
}
],
'class-name': [
Expand Down Expand Up @@ -359,7 +354,11 @@
greedy: true,
inside: createInterpolationInside(sInterpolation, sInterpolationRound),
}
]
],
'char': {
pattern: RegExp(character),
greedy: true
}
});

Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
Expand Down
2 changes: 1 addition & 1 deletion components/prism-csharp.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions tests/languages/csharp/char_feature.test
@@ -0,0 +1,11 @@
'a'
'\''
'\\'

----------------------------------------------------

[
["char", "'a'"],
["char", "'\\''"],
["char", "'\\\\'"]
]
10 changes: 1 addition & 9 deletions tests/languages/csharp/string_feature.test
Expand Up @@ -7,10 +7,6 @@
@"foo
bar"

'a'
'\''
'\\'

----------------------------------------------------

[
Expand All @@ -20,13 +16,9 @@ bar"
["string", "@\"\""],
["string", "@\"foo\""],
["string", "@\"fo\"\"o\""],
["string", "@\"foo\r\nbar\""],
["string", "'a'"],
["string", "'\\''"],
["string", "'\\\\'"]
["string", "@\"foo\r\nbar\""]
]

----------------------------------------------------

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

0 comments on commit 220bc40

Please sign in to comment.