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

Unified Diff: runtime/vm/parser.cc

Issue 10942025: Convert String and List to abstract classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to tip-of-tree. Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index b3d70daf812f44af6304c0446f23b9f086f00dba..41ac82613f826c6ea5906ca7e3c6de3b951a6827 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -1315,7 +1315,7 @@ ArgumentListNode* Parser::BuildNoSuchMethodArguments(
arguments->Add(new LiteralNode(args_pos, function_name));
// The third argument is an array containing the original function arguments.
ArrayNode* args_array = new ArrayNode(
- args_pos, Type::ZoneHandle(Type::ListInterface()));
+ args_pos, Type::ZoneHandle(Type::ListType()));
for (intptr_t i = 1; i < function_args.length(); i++) {
args_array->AddElement(function_args.NodeAt(i));
}
@@ -5046,7 +5046,7 @@ bool Parser::IsSimpleLiteral(const AbstractType& type, Instance* value) {
*value = CurrentDoubleLiteral();
return true;
} else if ((CurrentToken() == Token::kSTRING) &&
- (no_check || type.IsStringInterface())) {
+ (no_check || type.IsStringType())) {
*value = CurrentLiteral()->raw();
return true;
} else if ((CurrentToken() == Token::kTRUE) &&
@@ -8488,7 +8488,7 @@ AstNode* Parser::ParseListLiteral(intptr_t type_pos,
}
ASSERT(type_arguments.IsNull() || (type_arguments.Length() == 1));
const Class& list_class = Class::Handle(
- Type::Handle(Type::ListInterface()).type_class());
+ Type::Handle(Type::ListType()).type_class());
Type& type = Type::ZoneHandle(
Type::New(list_class, type_arguments, type_pos));
type ^= ClassFinalizer::FinalizeType(
@@ -8653,7 +8653,7 @@ AstNode* Parser::ParseMapLiteral(intptr_t type_pos,
"the key type and the value type");
}
TypeArguments& type_array = TypeArguments::Handle(TypeArguments::New(2));
- type_array.SetTypeAt(0, Type::Handle(Type::StringInterface()));
+ type_array.SetTypeAt(0, Type::Handle(Type::StringType()));
type_array.SetTypeAt(1, value_type);
map_type_arguments = type_array.raw();
} else if (map_type_arguments.Length() > 2) {
@@ -8664,7 +8664,7 @@ AstNode* Parser::ParseMapLiteral(intptr_t type_pos,
const AbstractType& key_type =
AbstractType::Handle(map_type_arguments.TypeAt(0));
value_type = map_type_arguments.TypeAt(1);
- if (!key_type.IsStringInterface()) {
+ if (!key_type.IsStringType()) {
ErrorMsg(type_pos, "the key type of a map literal must be 'String'");
}
}
@@ -8680,7 +8680,7 @@ AstNode* Parser::ParseMapLiteral(intptr_t type_pos,
// The kv_pair array is temporary and of element type Dynamic. It is passed
// to the factory to initialize a properly typed map.
ArrayNode* kv_pairs =
- new ArrayNode(TokenPos(), Type::ZoneHandle(Type::ListInterface()));
+ new ArrayNode(TokenPos(), Type::ZoneHandle(Type::ListType()));
// Parse the map entries. Note: there may be an optional extra
// comma after the last entry.
@@ -9192,7 +9192,7 @@ AstNode* Parser::ParseStringLiteral() {
// String interpolation needed.
bool is_compiletime_const = true;
ArrayNode* values = new ArrayNode(TokenPos(),
- Type::ZoneHandle(Type::ListInterface()));
+ Type::ZoneHandle(Type::ListType()));
while (CurrentToken() == Token::kSTRING) {
values->AddElement(new LiteralNode(TokenPos(), *CurrentLiteral()));
ConsumeToken();
@@ -9270,7 +9270,7 @@ AstNode* Parser::ParseArgumentDefinitionTest() {
saved_args_desc_var =
new LocalVariable(owner_function.token_pos(),
saved_args_desc_name,
- Type::ZoneHandle(Type::ListInterface()));
+ Type::ZoneHandle(Type::ListType()));
saved_args_desc_var->set_is_final();
// The saved arguments descriptor variable must be added just after the
// formal parameters. This simplifies the 2-step saving of a captured

Powered by Google App Engine
This is Rietveld 408576698