Files
sdk/pkg/front_end/parser_testcases/augmentation/member_declarations.dart
Johnni Winther cd41e43c48 [parser] Support 'augment' as a built-in identifier for augmentation libraries
This changes the way the 'augment' modifier is handled in the parser.
Instead of being special cased for class declarations, it is now a
built-in identifier recognized only when the scanner is configured to
support augmentation libraries.

The change supports the used of the 'augment' modifier on not only
class declarations but also mixin and member declarations, as needed
for supporting macros.

Change-Id: I2679d198dea360900cfc478fae9c1660702a8a02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233887
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-02-23 16:17:42 +00:00

61 lines
1.6 KiB
Dart

class Class {
augment method() {}
augment void method() {}
augment get getter => null;
augment int get getter => 0;
augment set setter(value) {}
augment void set setter(value) {}
augment var field;
augment final field = 0;
augment const field = 0;
augment int field;
augment late var field;
augment late final field;
augment late int field;
augment static method() {}
augment static void method() {}
augment static get getter => null;
augment static int get getter => 0;
augment static set setter(value) {}
augment static void set setter(value) {}
augment static var field;
augment static final field = 0;
augment static const field = 0;
augment static int field;
augment static late var field;
augment static late final field;
augment static late int field;
}
mixin Mixin {
augment method() {}
augment void method() {}
augment get getter => null;
augment int get getter => 0;
augment set setter(value) {}
augment void set setter(value) {}
augment var field;
augment final field = 0;
augment const field = 0;
augment int field;
augment late var field;
augment late final field;
augment late int field;
augment static method() {}
augment static void method() {}
augment static get getter => null;
augment static int get getter => 0;
augment static set setter(value) {}
augment static void set setter(value) {}
augment static var field;
augment static final field = 0;
augment static const field = 0;
augment static int field;
augment static late var field;
augment static late final field;
augment static late int field;
}