| OLD | NEW |
| 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 | 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 4253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4264 } else if (IsLiteral("export")) { | 4264 } else if (IsLiteral("export")) { |
| 4265 ErrorMsg("export clause not yet supported"); | 4265 ErrorMsg("export clause not yet supported"); |
| 4266 } else { | 4266 } else { |
| 4267 ErrorMsg("unreachable"); | 4267 ErrorMsg("unreachable"); |
| 4268 UNREACHABLE(); | 4268 UNREACHABLE(); |
| 4269 } | 4269 } |
| 4270 } | 4270 } |
| 4271 | 4271 |
| 4272 | 4272 |
| 4273 void Parser::ParseLibraryPart() { | 4273 void Parser::ParseLibraryPart() { |
| 4274 ErrorMsg("library part definitions not implemented"); | 4274 const intptr_t source_pos = TokenPos(); |
| 4275 ConsumeToken(); // Consume "part". |
| 4276 if (CurrentToken() != Token::kSTRING) { |
| 4277 ErrorMsg("url expected"); |
| 4278 } |
| 4279 const String& url = *CurrentLiteral(); |
| 4280 ConsumeToken(); |
| 4281 ExpectSemicolon(); |
| 4282 Dart_Handle handle = |
| 4283 CallLibraryTagHandler(kCanonicalizeUrl, source_pos, url); |
| 4284 const String& canon_url = String::CheckedHandle(Api::UnwrapHandle(handle)); |
| 4285 CallLibraryTagHandler(kSourceTag, source_pos, canon_url); |
| 4275 } | 4286 } |
| 4276 | 4287 |
| 4277 | 4288 |
| 4278 void Parser::ParseLibraryDefinition() { | 4289 void Parser::ParseLibraryDefinition() { |
| 4279 TRACE_PARSER("ParseLibraryDefinition"); | 4290 TRACE_PARSER("ParseLibraryDefinition"); |
| 4280 | 4291 |
| 4281 // Handle the script tag. | 4292 // Handle the script tag. |
| 4282 if (CurrentToken() == Token::kSCRIPTTAG) { | 4293 if (CurrentToken() == Token::kSCRIPTTAG) { |
| 4283 // Nothing to do for script tags except to skip them. | 4294 // Nothing to do for script tags except to skip them. |
| 4284 ConsumeToken(); | 4295 ConsumeToken(); |
| (...skipping 5375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9660 void Parser::SkipQualIdent() { | 9671 void Parser::SkipQualIdent() { |
| 9661 ASSERT(IsIdentifier()); | 9672 ASSERT(IsIdentifier()); |
| 9662 ConsumeToken(); | 9673 ConsumeToken(); |
| 9663 if (CurrentToken() == Token::kPERIOD) { | 9674 if (CurrentToken() == Token::kPERIOD) { |
| 9664 ConsumeToken(); // Consume the kPERIOD token. | 9675 ConsumeToken(); // Consume the kPERIOD token. |
| 9665 ExpectIdentifier("identifier expected after '.'"); | 9676 ExpectIdentifier("identifier expected after '.'"); |
| 9666 } | 9677 } |
| 9667 } | 9678 } |
| 9668 | 9679 |
| 9669 } // namespace dart | 9680 } // namespace dart |
| OLD | NEW |