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

Unified Diff: vm/scopes.cc

Issue 10632009: Make the parser agnostic to the TokenStream implementation. This is the first step towards compacti… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « vm/scopes.h ('k') | vm/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/scopes.cc
===================================================================
--- vm/scopes.cc (revision 9042)
+++ vm/scopes.cc (working copy)
@@ -30,8 +30,8 @@
loop_level_(loop_level),
context_level_(LocalScope::kUnitializedContextLevel),
num_context_variables_(0),
- begin_token_index_(0),
- end_token_index_(0),
+ begin_token_pos_(0),
+ end_token_pos_(0),
variables_(),
labels_() {
// Hook this node into the children of the parent, unless the parent has a
@@ -195,8 +195,8 @@
desc.name = &String::Handle(context_scope.NameAt(i));
desc.info.kind = RawLocalVarDescriptors::kContextVar;
desc.info.scope_id = context_scope.ContextLevelAt(i);
- desc.info.begin_pos = begin_token_index();
- desc.info.end_pos = end_token_index();
+ desc.info.begin_pos = begin_token_pos();
+ desc.info.end_pos = end_token_pos();
desc.info.index = context_scope.ContextIndexAt(i);
vars.Add(desc);
}
@@ -229,8 +229,8 @@
desc.name = &String::Handle(); // No name.
desc.info.kind = RawLocalVarDescriptors::kContextLevel;
desc.info.scope_id = *scope_id;
- desc.info.begin_pos = begin_token_index();
- desc.info.end_pos = end_token_index();
+ desc.info.begin_pos = begin_token_pos();
+ desc.info.end_pos = end_token_pos();
desc.info.index = context_level();
vars->Add(desc);
}
@@ -250,8 +250,8 @@
desc.info.kind = RawLocalVarDescriptors::kStackVar;
desc.info.scope_id = *scope_id;
}
- desc.info.begin_pos = var->token_index();
- desc.info.end_pos = var->owner()->end_token_index();
+ desc.info.begin_pos = var->token_pos();
+ desc.info.end_pos = var->owner()->end_token_pos();
desc.info.index = var->index();
vars->Add(desc);
} else if (var->name().Equals(LocalVariable::kSavedContextVarName)) {
@@ -451,7 +451,7 @@
LocalVariable* variable = VariableAt(i);
// Preserve the aliases of captured variables belonging to outer scopes.
if (variable->owner()->function_level() != 1) {
- context_scope.SetTokenIndexAt(captured_idx, variable->token_index());
+ context_scope.SetTokenIndexAt(captured_idx, variable->token_pos());
context_scope.SetNameAt(captured_idx, variable->name());
context_scope.SetIsFinalAt(captured_idx, variable->is_final());
context_scope.SetTypeAt(captured_idx, variable->type());
@@ -505,7 +505,7 @@
// Create a descriptor for 'this' variable.
const String& name = String::Handle(String::NewSymbol("this"));
- context_scope.SetTokenIndexAt(0, func.token_index());
+ context_scope.SetTokenIndexAt(0, func.token_pos());
context_scope.SetNameAt(0, name);
context_scope.SetIsFinalAt(0, true);
const AbstractType& type = AbstractType::Handle(func.ParameterTypeAt(0));
« no previous file with comments | « vm/scopes.h ('k') | vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698