Skip to content

Commit bf5fb79

Browse files
author
sgrekhov
committed
#912. More external variables syntax tests added
1 parent 20e39ea commit bf5fb79

18 files changed

+690
-2
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
30+
final external int i1;
31+
//^^^^^
32+
// [analyzer] unspecified
33+
// [cfe] unspecified
34+
35+
final external i2;
36+
//^^^^^
37+
// [analyzer] unspecified
38+
// [cfe] unspecified
39+
40+
main() {
41+
}

LanguageFeatures/Abstract-external-fields/syntax_t01.dart renamed to LanguageFeatures/Abstract-external-fields/syntax_A01_t02.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
2828
*/
2929

30-
final external int i1;
31-
//^^^^^
30+
external i;
31+
// ^
3232
// [analyzer] unspecified
3333
// [cfe] unspecified
3434

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
30+
external final int i1, i2;
31+
external final x1, x2;
32+
33+
test() {
34+
int j = i1;
35+
int k = i2;
36+
String s1 = x1;
37+
String s2 = x2;
38+
}
39+
main() {
40+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
30+
int? external i1;
31+
// ^^^^^^^^
32+
// [analyzer] unspecified
33+
// [cfe] unspecified
34+
35+
main() {
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
30+
var external i2;
31+
// ^^^^^^^^
32+
// [analyzer] unspecified
33+
// [cfe] unspecified
34+
35+
main() {
36+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
class C {
30+
final external int i1;
31+
//^^^^^
32+
// [analyzer] unspecified
33+
// [cfe] unspecified
34+
35+
final external i2;
36+
//^^^^^
37+
// [analyzer] unspecified
38+
// [cfe] unspecified
39+
}
40+
41+
main() {
42+
new C();
43+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
class C {
30+
external i;
31+
// ^
32+
// [analyzer] unspecified
33+
// [cfe] unspecified
34+
}
35+
36+
main() {
37+
new C();
38+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
30+
class C {
31+
external final int i1, i2;
32+
external final x1, x2;
33+
34+
test() {
35+
int j = i1;
36+
int k = i2;
37+
String s1 = x1;
38+
String s2 = x2;
39+
}
40+
}
41+
42+
main() {
43+
new C();
44+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
class C {
30+
int? external i1;
31+
// ^^^^^^^^
32+
// [analyzer] unspecified
33+
// [cfe] unspecified
34+
}
35+
36+
main() {
37+
new C();
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
3+
* for details. All rights reserved. Use of this source code is governed by a
4+
* BSD-style license that can be found in the LICENSE file.
5+
*/
6+
/**
7+
* @assertion The grammar is modified as follows:
8+
*
9+
* <topLevelDefinition> ::=
10+
* ... |
11+
* // New alternative.
12+
* 'external' <finalVarOrType> <identifierList> ';'
13+
*
14+
* <finalVarOrType> ::= // New rule.
15+
* 'final' <type>? |
16+
* <varOrType>
17+
*
18+
* <declaration> ::=
19+
* ... |
20+
* // New alternative.
21+
* 'external' ('static'? <finalVarOrType> | 'covariant' <varOrType>)
22+
* <identifierList> |
23+
* // New alternative.
24+
* 'abstract' (<finalVarOrType> | 'covariant' <varOrType>) <identifierList>
25+
*
26+
* @description Checks topLevelDefinition syntax
27+
28+
*/
29+
class C {
30+
var external i2;
31+
// ^^^^^^^^
32+
// [analyzer] unspecified
33+
// [cfe] unspecified
34+
}
35+
36+
main() {
37+
new C();
38+
}

0 commit comments

Comments
 (0)