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

Unified Diff: runtime/vm/scopes.cc

Issue 1644793002: Replace intptr_t with TokenDescriptor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/scopes.h ('k') | runtime/vm/scopes_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scopes.cc
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc
index 9b609c1fe41f0331213221ea4ba033d1825296c1..6060e7a075a2df3d5fd149fb97980839685fb1d3 100644
--- a/runtime/vm/scopes.cc
+++ b/runtime/vm/scopes.cc
@@ -29,8 +29,8 @@ LocalScope::LocalScope(LocalScope* parent, int function_level, int loop_level)
loop_level_(loop_level),
context_level_(LocalScope::kUnitializedContextLevel),
num_context_variables_(0),
- begin_token_pos_(Token::kNoSourcePos),
- end_token_pos_(Token::kNoSourcePos),
+ begin_token_pos_(TokenPosition::kNoSourcePos),
+ end_token_pos_(TokenPosition::kNoSourcePos),
variables_(),
labels_(),
referenced_() {
@@ -110,7 +110,7 @@ NameReference* LocalScope::FindReference(const String& name) const {
}
-void LocalScope::AddReferencedName(intptr_t token_pos,
+void LocalScope::AddReferencedName(TokenPosition token_pos,
const String& name) {
if (LocalLookupVariable(name) != NULL) {
return;
@@ -132,12 +132,12 @@ void LocalScope::AddReferencedName(intptr_t token_pos,
}
-intptr_t LocalScope::PreviousReferencePos(const String& name) const {
+TokenPosition LocalScope::PreviousReferencePos(const String& name) const {
NameReference* ref = FindReference(name);
if (ref != NULL) {
return ref->token_pos();
}
- return -1;
+ return TokenPosition::kNoSource;
}
@@ -328,8 +328,8 @@ void LocalScope::CollectLocalVariables(GrowableArray<VarDesc>* vars,
desc.name = &var->name();
desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext);
desc.info.scope_id = 0;
- desc.info.begin_pos = 0;
- desc.info.end_pos = 0;
+ desc.info.begin_pos = TokenPosition::kMinSource;
+ desc.info.end_pos = TokenPosition::kMinSource;
desc.info.set_index(var->index());
vars->Add(desc);
} else if (!IsFilteredIdentifier(var->name())) {
« no previous file with comments | « runtime/vm/scopes.h ('k') | runtime/vm/scopes_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698