Skip to content

Commit

Permalink
Support number literal separators in Dart
Browse files Browse the repository at this point in the history
FIX: Add support for underscore separators in numbers in the Dart mode.
  • Loading branch information
marijnh committed Sep 5, 2024
1 parent 2675b58 commit 57e2fc9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mode/clike.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,8 @@ export const dart = clike({
blockKeywords: words("try catch finally do else for if switch while"),
builtin: words("void bool num int double dynamic var String Null Never"),
atoms: words("true false null"),
// clike numbers without the suffixes, and with '_' separators.
number: /^(?:0x[a-f\d_]+|(?:[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?)/i,
hooks: {
"@": function(stream) {
stream.eatWhile(/[\w\$_\.]/);
Expand Down

0 comments on commit 57e2fc9

Please sign in to comment.