diff --git a/CHANGELOG.md b/CHANGELOG.md index 048e11a..658e7b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.0 (2024-07-31) + +- Added support for digit separators (`_`). + ## 1.2.9 (2024-04-24) - Added support for `macro`, `augment library`, `import augment`, `augment`, `augmented`. diff --git a/grammars/dart.json b/grammars/dart.json index 7dfa571..6a4877b 100644 --- a/grammars/dart.json +++ b/grammars/dart.json @@ -1,6 +1,6 @@ { "name": "Dart", - "version": "1.2.9", + "version": "1.3.0", "fileTypes": [ "dart" ], @@ -215,7 +215,7 @@ }, { "name": "constant.numeric.dart", - "match": "(?// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart +>// for details. All rights reserved. Use of this source code is governed by a +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart +>// BSD-style license that can be found in the LICENSE file. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart +> +>var a = [ +#^^^ storage.type.primitive.dart +# ^ keyword.operator.assignment.dart +> 1, +# ^ constant.numeric.dart +# ^ punctuation.comma.dart +> .0, +# ^ punctuation.dot.dart +# ^ constant.numeric.dart +# ^ punctuation.comma.dart +> 1.2, +# ^^^ constant.numeric.dart +# ^ punctuation.comma.dart +> 0x123, +# ^^^^^ constant.numeric.dart +# ^ punctuation.comma.dart +> 100__000_000__000_000__000_000, +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.numeric.dart +# ^ punctuation.comma.dart +> 0x4000_0000_0000_0000, +# ^^^^^^^^^^^^^^^^^^^^^ constant.numeric.dart +# ^ punctuation.comma.dart +> 0.000_000_000_01, +# ^^^^^^^^^^^^^^^^ constant.numeric.dart +# ^ punctuation.comma.dart +> 0x00_14_22_01_23_45, +# ^^^^^^^^^^^^^^^^^^^ constant.numeric.dart +# ^ punctuation.comma.dart +> 555_123_4567, +# ^^^^^^^^^^^^ constant.numeric.dart +# ^ punctuation.comma.dart +>]; +# ^ punctuation.terminator.dart diff --git a/test/test_files/numbers.dart b/test/test_files/numbers.dart new file mode 100644 index 0000000..27dde38 --- /dev/null +++ b/test/test_files/numbers.dart @@ -0,0 +1,15 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +var a = [ + 1, + .0, + 1.2, + 0x123, + 100__000_000__000_000__000_000, + 0x4000_0000_0000_0000, + 0.000_000_000_01, + 0x00_14_22_01_23_45, + 555_123_4567, +];