| 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 part of native; | 5 import '../common.dart'; |
| 6 import '../parser/listener.dart' show |
| 7 Listener; |
| 8 import '../parser/element_listener.dart' show |
| 9 ElementListener; |
| 10 import '../tokens/token.dart' show |
| 11 BeginGroupToken, |
| 12 Token; |
| 13 import '../tokens/token_constants.dart' as Tokens show |
| 14 EOF_TOKEN, |
| 15 STRING_TOKEN; |
| 6 | 16 |
| 7 void checkAllowedLibrary(ElementListener listener, Token token) { | 17 void checkAllowedLibrary(ElementListener listener, Token token) { |
| 8 if (listener.scannerOptions.canUseNative) return; | 18 if (listener.scannerOptions.canUseNative) return; |
| 9 listener.reportError(token, MessageKind.NATIVE_NOT_SUPPORTED); | 19 listener.reportError(token, MessageKind.NATIVE_NOT_SUPPORTED); |
| 10 } | 20 } |
| 11 | 21 |
| 12 Token handleNativeBlockToSkip(Listener listener, Token token) { | 22 Token handleNativeBlockToSkip(Listener listener, Token token) { |
| 13 checkAllowedLibrary(listener, token); | 23 checkAllowedLibrary(listener, token); |
| 14 token = token.next; | 24 token = token.next; |
| 15 if (identical(token.kind, Tokens.STRING_TOKEN)) { | 25 if (identical(token.kind, Tokens.STRING_TOKEN)) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 32 hasExpression = true; | 42 hasExpression = true; |
| 33 listener.beginLiteralString(token); | 43 listener.beginLiteralString(token); |
| 34 listener.endLiteralString(0); | 44 listener.endLiteralString(0); |
| 35 token = token.next; | 45 token = token.next; |
| 36 } | 46 } |
| 37 listener.endReturnStatement(hasExpression, begin, token); | 47 listener.endReturnStatement(hasExpression, begin, token); |
| 38 // TODO(ngeoffray): expect a ';'. | 48 // TODO(ngeoffray): expect a ';'. |
| 39 // Currently there are method with both native marker and Dart body. | 49 // Currently there are method with both native marker and Dart body. |
| 40 return token.next; | 50 return token.next; |
| 41 } | 51 } |
| OLD | NEW |