Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -26,6 +26,7 @@ Core Grammars:
- enh(json) add json5 support [Kerry Shetline][]
- fix(css) `unicode-range` parsing, issue #4253 [Kerry Shetline][]
- fix(csharp) Support digit separators [te-ing][]
- enh(rust) parse f16 and f128 literals [usamoi][]

Documentation:

Expand Down Expand Up @@ -55,6 +56,7 @@ CONTRIBUTORS
[te-ing]: https://github.com/te-ing
[Anthony Martin]: https://github.com/anthony-c-martin
[NriotHrreion]: https://github.com/NriotHrreion
[usamoi]: https://github.com/usamoi


## Version 11.11.1
Expand Down
4 changes: 3 additions & 1 deletion src/languages/rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function(hljs) {
IDENT_RE,
regex.lookahead(/\s*\(/))
};
const NUMBER_SUFFIX = '([ui](8|16|32|64|128|size)|f(32|64))\?';
const NUMBER_SUFFIX = '([ui](8|16|32|64|128|size)|f(16|32|64|128))\?';
const KEYWORDS = [
"abstract",
"as",
Expand Down Expand Up @@ -169,8 +169,10 @@ export default function(hljs) {
"u64",
"u128",
"usize",
"f16",
"f32",
"f64",
"f128",
"str",
"char",
"bool",
Expand Down
2 changes: 2 additions & 0 deletions test/markup/rust/numbers.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
<span class="hljs-number">0.1</span>;
<span class="hljs-number">0.1f32</span>;
<span class="hljs-number">12E+99_f64</span>;
<span class="hljs-number">12E+99_f16</span>;
<span class="hljs-number">12E+99_f128</span>;
2 changes: 2 additions & 0 deletions test/markup/rust/numbers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
0.1;
0.1f32;
12E+99_f64;
12E+99_f16;
12E+99_f128;