Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: runtime/vm/parser.cc

Issue 2640853005: Make Analyzer, VM and dart2js accept URI strings as part-of library identifier. (Closed)
Patch Set: Add tests, enable flag by default in analyzer. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 6176 matching lines...) Expand 10 before | Expand all | Expand 10 after
6187 6187
6188 6188
6189 void Parser::ParsePartHeader() { 6189 void Parser::ParsePartHeader() {
6190 SkipMetadata(); 6190 SkipMetadata();
6191 CheckToken(Token::kPART, "'part of' expected"); 6191 CheckToken(Token::kPART, "'part of' expected");
6192 ConsumeToken(); 6192 ConsumeToken();
6193 if (!IsSymbol(Symbols::Of())) { 6193 if (!IsSymbol(Symbols::Of())) {
6194 ReportError("'part of' expected"); 6194 ReportError("'part of' expected");
6195 } 6195 }
6196 ConsumeToken(); 6196 ConsumeToken();
6197 // The VM is not required to check that the library name matches the 6197 // The VM is not required to check that the library name or URI matches the
6198 // name of the current library, so we ignore it. 6198 // name or URI of the current library, so we ignore them.
6199 ExpectIdentifier("library name expected"); 6199 if (CurrentToken() == Token::kSTRING) {
6200 while (CurrentToken() == Token::kPERIOD) { 6200 ParseStringLiteral(false);
6201 ConsumeToken(); 6201 } else {
6202 ExpectIdentifier("malformed library name"); 6202 ExpectIdentifier("library name expected");
6203 while (CurrentToken() == Token::kPERIOD) {
6204 ConsumeToken();
6205 ExpectIdentifier("malformed library name");
6206 }
6203 } 6207 }
6204 ExpectSemicolon(); 6208 ExpectSemicolon();
6205 } 6209 }
6206 6210
6207 6211
6208 void Parser::ParseTopLevel() { 6212 void Parser::ParseTopLevel() {
6209 TRACE_PARSER("ParseTopLevel"); 6213 TRACE_PARSER("ParseTopLevel");
6210 // Collect the classes found at the top level in this growable array. 6214 // Collect the classes found at the top level in this growable array.
6211 // They need to be registered with class finalization after parsing 6215 // They need to be registered with class finalization after parsing
6212 // has been completed. 6216 // has been completed.
(...skipping 8455 matching lines...) Expand 10 before | Expand all | Expand 10 after
14668 const ArgumentListNode& function_args, 14672 const ArgumentListNode& function_args,
14669 const LocalVariable* temp_for_last_arg, 14673 const LocalVariable* temp_for_last_arg,
14670 bool is_super_invocation) { 14674 bool is_super_invocation) {
14671 UNREACHABLE(); 14675 UNREACHABLE();
14672 return NULL; 14676 return NULL;
14673 } 14677 }
14674 14678
14675 } // namespace dart 14679 } // namespace dart
14676 14680
14677 #endif // DART_PRECOMPILED_RUNTIME 14681 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698