| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import '../common.dart'; | 5 import '../common.dart'; |
| 6 import '../parser/element_listener.dart' show ElementListener; | 6 import '../parser/element_listener.dart' show ElementListener; |
| 7 import 'package:front_end/src/fasta/scanner.dart' | 7 import 'package:front_end/src/fasta/scanner.dart' show BeginGroupToken, Token; |
| 8 show BeginGroupToken, Token; | |
| 9 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens | 8 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens |
| 10 show STRING_TOKEN; | 9 show STRING_TOKEN; |
| 11 | 10 |
| 12 void checkAllowedLibrary(ElementListener listener, Token token) { | 11 void checkAllowedLibrary(ElementListener listener, Token token) { |
| 13 if (listener.scannerOptions.canUseNative) return; | 12 if (listener.scannerOptions.canUseNative) return; |
| 14 listener.reportErrorFromToken(token, MessageKind.NATIVE_NOT_SUPPORTED); | 13 listener.reportErrorFromToken(token, MessageKind.NATIVE_NOT_SUPPORTED); |
| 15 } | 14 } |
| 16 | 15 |
| 17 Token handleNativeBlockToSkip(ElementListener listener, Token token) { | 16 Token handleNativeBlockToSkip(ElementListener listener, Token token) { |
| 18 checkAllowedLibrary(listener, token); | 17 checkAllowedLibrary(listener, token); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 37 hasExpression = true; | 36 hasExpression = true; |
| 38 listener.beginLiteralString(token); | 37 listener.beginLiteralString(token); |
| 39 listener.endLiteralString(0); | 38 listener.endLiteralString(0); |
| 40 token = token.next; | 39 token = token.next; |
| 41 } | 40 } |
| 42 listener.endReturnStatement(hasExpression, begin, token); | 41 listener.endReturnStatement(hasExpression, begin, token); |
| 43 // TODO(ngeoffray): expect a ';'. | 42 // TODO(ngeoffray): expect a ';'. |
| 44 // Currently there are method with both native marker and Dart body. | 43 // Currently there are method with both native marker and Dart body. |
| 45 return token.next; | 44 return token.next; |
| 46 } | 45 } |
| OLD | NEW |