Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Core Grammars:
- fix(diff) fix unified diff hunk header regex to allow unpaired numbers [Chris Wilson][]
- enh(php) support single line and hash comments in attributes, constructor and functions [Antoine Musso][]
- enh(json) add json5 support [Kerry Shetline][]
- fix(csharp) Support digit separators [te-ing][]

Documentation:

Expand All @@ -46,6 +47,7 @@ CONTRIBUTORS
[Kerry Shetline]: https://github.com/kshetline
[Twineee1]: https://github.com/Twineee1
[hbgl]: https://github.com/hbgl
[te-ing]: https://github.com/te-ing


## Version 11.11.1
Expand Down
2 changes: 1 addition & 1 deletion src/languages/csharp.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default function(hljs) {
variants: [
{ begin: '\\b(0b[01\']+)' },
{ begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)(u|U|l|L|ul|UL|f|F|b|B)' },
{ begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)' }
{ begin: '(-?)(\\b0[xX][a-fA-F0-9\'_]+|(\\b[\\d\'_]+(\\.[\\d\'_]*)?|\\.[\\d\'_]+)([eE][-+]?[\\d\'_]+)?)' }
],
relevance: 0
};
Expand Down
4 changes: 3 additions & 1 deletion test/markup/csharp/floats.expect.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<span class="hljs-built_in">float</span> test = <span class="hljs-number">1.0f</span>;
<span class="hljs-built_in">float</span> test2 = <span class="hljs-number">1.f</span>;
<span class="hljs-built_in">float</span> test3 = <span class="hljs-number">1.0</span>;
<span class="hljs-built_in">float</span> test4 = <span class="hljs-number">1</span>;
<span class="hljs-built_in">float</span> test4 = <span class="hljs-number">1</span>;
<span class="hljs-built_in">float</span> test5 = <span class="hljs-number">1_000</span>;

3 changes: 2 additions & 1 deletion test/markup/csharp/floats.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
float test = 1.0f;
float test2 = 1.f;
float test3 = 1.0;
float test4 = 1;
float test4 = 1;
float test5 = 1_000;