OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/parser.h" | 5 #include "vm/parser.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
(...skipping 3078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3089 const String& name = *CurrentLiteral(); | 3089 const String& name = *CurrentLiteral(); |
3090 ConsumeToken(); | 3090 ConsumeToken(); |
3091 ExpectToken(Token::kRPAREN); | 3091 ExpectToken(Token::kRPAREN); |
3092 ExpectToken(Token::kSEMICOLON); | 3092 ExpectToken(Token::kSEMICOLON); |
3093 library_.SetName(name); | 3093 library_.SetName(name); |
3094 } | 3094 } |
3095 } | 3095 } |
3096 | 3096 |
3097 | 3097 |
3098 Dart_Handle Parser::CallLibraryTagHandler(Dart_LibraryTag tag, | 3098 Dart_Handle Parser::CallLibraryTagHandler(Dart_LibraryTag tag, |
3099 intptr_t token_pos, | 3099 intptr_t token_pos, |
3100 const String& url) { | 3100 const String& url) { |
3101 Dart_LibraryTagHandler handler = Isolate::Current()->library_tag_handler(); | 3101 Dart_LibraryTagHandler handler = Isolate::Current()->library_tag_handler(); |
3102 bool is_native_flds_library_url = url.Equals("dart:core-native-fields"); | |
Ivan Posva
2011/11/16 19:19:53
I do not see any reason why this library needs to
siva
2011/11/17 00:04:28
Removed.
On 2011/11/16 19:19:53, Ivan Posva wrote
| |
3103 if (is_native_flds_library_url) { | |
3104 if (tag == kCanonicalizeUrl) { | |
3105 return Api::NewLocalHandle(url); | |
3106 } | |
3107 const Library& library = Library::Handle(Library::LookupLibrary(url)); | |
3108 ASSERT(!library.IsNull()); | |
3109 return Api::NewLocalHandle(library); | |
3110 } | |
3102 if (handler == NULL) { | 3111 if (handler == NULL) { |
3103 ErrorMsg(token_pos, "no library handler registered"); | 3112 ErrorMsg(token_pos, "no library handler registered"); |
3104 } | 3113 } |
3105 Dart_Handle result = handler(tag, | 3114 Dart_Handle result = handler(tag, |
3106 Api::NewLocalHandle(library_), | 3115 Api::NewLocalHandle(library_), |
3107 Api::NewLocalHandle(url)); | 3116 Api::NewLocalHandle(url)); |
3108 if (Dart_IsError(result)) { | 3117 if (Dart_IsError(result)) { |
3109 ErrorMsg(token_pos, "library handler failed: %s", Dart_GetError(result)); | 3118 ErrorMsg(token_pos, "library handler failed: %s", Dart_GetError(result)); |
3110 } | 3119 } |
3111 return result; | 3120 return result; |
(...skipping 4177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7289 } | 7298 } |
7290 | 7299 |
7291 | 7300 |
7292 void Parser::SkipNestedExpr() { | 7301 void Parser::SkipNestedExpr() { |
7293 const bool saved_mode = SetAllowFunctionLiterals(true); | 7302 const bool saved_mode = SetAllowFunctionLiterals(true); |
7294 SkipExpr(); | 7303 SkipExpr(); |
7295 SetAllowFunctionLiterals(saved_mode); | 7304 SetAllowFunctionLiterals(saved_mode); |
7296 } | 7305 } |
7297 | 7306 |
7298 } // namespace dart | 7307 } // namespace dart |
OLD | NEW |