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

Side by Side Diff: vm/parser.cc

Issue 8500006: Library prefix should be an identifier (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | vm/scanner.h » ('j') | vm/scanner.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3144 matching lines...) Expand 10 before | Expand all | Expand 10 after
3155 if ((CurrentToken() != Token::kIDENT) || 3155 if ((CurrentToken() != Token::kIDENT) ||
3156 !kPrefix.Equals(*CurrentLiteral())) { 3156 !kPrefix.Equals(*CurrentLiteral())) {
3157 ErrorMsg("prefix: expected"); 3157 ErrorMsg("prefix: expected");
3158 } 3158 }
3159 ConsumeToken(); 3159 ConsumeToken();
3160 ExpectToken(Token::kCOLON); 3160 ExpectToken(Token::kCOLON);
3161 if (CurrentToken() != Token::kSTRING) { 3161 if (CurrentToken() != Token::kSTRING) {
3162 ErrorMsg("prefix expected"); 3162 ErrorMsg("prefix expected");
3163 } 3163 }
3164 prefix = CurrentLiteral()->raw(); 3164 prefix = CurrentLiteral()->raw();
3165 // TODO(asiva): Need to also check that prefix is not a reserved keyword.
3166 if (!Scanner::IsIdent(prefix)) {
3167 ErrorMsg("prefix should be an identifier");
3168 }
3165 ConsumeToken(); 3169 ConsumeToken();
3166 } 3170 }
3167 ExpectToken(Token::kRPAREN); 3171 ExpectToken(Token::kRPAREN);
3168 ExpectToken(Token::kSEMICOLON); 3172 ExpectToken(Token::kSEMICOLON);
3169 Dart_Handle handle = CallLibraryTagHandler(kCanonicalizeUrl, 3173 Dart_Handle handle = CallLibraryTagHandler(kCanonicalizeUrl,
3170 import_pos, 3174 import_pos,
3171 url); 3175 url);
3172 const String& canon_url = String::CheckedHandle(Api::UnwrapHandle(handle)); 3176 const String& canon_url = String::CheckedHandle(Api::UnwrapHandle(handle));
3173 // Lookup the library URL. 3177 // Lookup the library URL.
3174 Library& library = Library::Handle(Library::LookupLibrary(canon_url)); 3178 Library& library = Library::Handle(Library::LookupLibrary(canon_url));
(...skipping 4254 matching lines...) Expand 10 before | Expand all | Expand 10 after
7429 } 7433 }
7430 7434
7431 7435
7432 void Parser::SkipNestedExpr() { 7436 void Parser::SkipNestedExpr() {
7433 const bool saved_mode = SetAllowFunctionLiterals(true); 7437 const bool saved_mode = SetAllowFunctionLiterals(true);
7434 SkipExpr(); 7438 SkipExpr();
7435 SetAllowFunctionLiterals(saved_mode); 7439 SetAllowFunctionLiterals(saved_mode);
7436 } 7440 }
7437 7441
7438 } // namespace dart 7442 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/scanner.h » ('j') | vm/scanner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698