diff --git a/lexers/embedded/dart.xml b/lexers/embedded/dart.xml
index 9fef38d..f1b454f 100644
--- a/lexers/embedded/dart.xml
+++ b/lexers/embedded/dart.xml
@@ -97,7 +97,7 @@
-
+
diff --git a/lexers/testdata/dart.actual b/lexers/testdata/dart.actual
index b3f4bd6..a7f0670 100644
--- a/lexers/testdata/dart.actual
+++ b/lexers/testdata/dart.actual
@@ -3,8 +3,8 @@ import 'dart:html';
import 'dart:math' show Random;
// We changed 5 lines of code to make this sample nicer on
-// the web (so that the execution waits for animation frame,
-// the number gets updated in the DOM, and the program ends
+// the web (so that the execution waits for animation frame,
+// the number gets updated in the DOM, and the program ends
// after 500 iterations).
main() async {
@@ -39,12 +39,12 @@ Stream computePi({int batch: 100000}) async* {
Iterable generateRandom([int seed]) sync* {
final random = new Random(seed);
while (true) {
- yield new Point(random.nextDouble(), random.nextDouble());
+ yield new Point(x: random.nextDouble(), y: random.nextDouble());
}
}
class Point {
final double x, y;
- const Point(this.x, this.y);
+ const Point({required this.x, required this.y});
bool get isInsideUnitCircle => x * x + y * y <= 1;
}
\ No newline at end of file
diff --git a/lexers/testdata/dart.expected b/lexers/testdata/dart.expected
index 36b0a81..9e77b74 100644
--- a/lexers/testdata/dart.expected
+++ b/lexers/testdata/dart.expected
@@ -18,7 +18,7 @@
{"type":"Name","value":"Random"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
- {"type":"CommentSingle","value":"// We changed 5 lines of code to make this sample nicer on\n// the web (so that the execution waits for animation frame, \n// the number gets updated in the DOM, and the program ends \n// after 500 iterations).\n"},
+ {"type":"CommentSingle","value":"// We changed 5 lines of code to make this sample nicer on\n// the web (so that the execution waits for animation frame,\n// the number gets updated in the DOM, and the program ends\n// after 500 iterations).\n"},
{"type":"Text","value":"\n"},
{"type":"Name","value":"main"},
{"type":"Punctuation","value":"()"},
@@ -270,11 +270,15 @@
{"type":"Text","value":" "},
{"type":"Name","value":"Point"},
{"type":"Punctuation","value":"("},
+ {"type":"NameLabel","value":"x:"},
+ {"type":"Text","value":" "},
{"type":"Name","value":"random"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"nextDouble"},
{"type":"Punctuation","value":"(),"},
{"type":"Text","value":" "},
+ {"type":"NameLabel","value":"y:"},
+ {"type":"Text","value":" "},
{"type":"Name","value":"random"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"nextDouble"},
@@ -303,16 +307,20 @@
{"type":"KeywordDeclaration","value":"const"},
{"type":"Text","value":" "},
{"type":"Name","value":"Point"},
- {"type":"Punctuation","value":"("},
+ {"type":"Punctuation","value":"({"},
+ {"type":"KeywordDeclaration","value":"required"},
+ {"type":"Text","value":" "},
{"type":"Keyword","value":"this"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"x"},
{"type":"Punctuation","value":","},
{"type":"Text","value":" "},
+ {"type":"KeywordDeclaration","value":"required"},
+ {"type":"Text","value":" "},
{"type":"Keyword","value":"this"},
{"type":"Punctuation","value":"."},
{"type":"Name","value":"y"},
- {"type":"Punctuation","value":");"},
+ {"type":"Punctuation","value":"});"},
{"type":"Text","value":"\n "},
{"type":"KeywordType","value":"bool"},
{"type":"Text","value":" "},