File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -1162,7 +1162,11 @@ class AstNodeVisitor extends ThrowingAstVisitor<Piece> with PieceFactory {
1162
1162
1163
1163
@override
1164
1164
Piece visitNativeFunctionBody (NativeFunctionBody node) {
1165
- throw UnimplementedError ();
1165
+ return buildPiece ((b) {
1166
+ b.token (node.nativeKeyword);
1167
+ b.visit (node.stringLiteral, spaceBefore: true );
1168
+ b.token (node.semicolon);
1169
+ });
1166
1170
}
1167
1171
1168
1172
@override
Original file line number Diff line number Diff line change
1
+ 40 columns |
2
+ >>> Without strings.
3
+ class Foo {
4
+ Foo() native ;
5
+ int bar() native ;
6
+ }
7
+ <<<
8
+ class Foo {
9
+ Foo() native;
10
+ int bar() native;
11
+ }
12
+ >>> With strings.
13
+ class Foo {
14
+ Foo() native "Foo" ;
15
+ int bar() native "bar" ;
16
+ }
17
+ <<<
18
+ class Foo {
19
+ Foo() native "Foo";
20
+ int bar() native "bar";
21
+ }
22
+ >>> class
23
+ class Foo native "Foo" { }
24
+ <<<
25
+ class Foo native "Foo" {}
You can’t perform that action at this time.
0 commit comments