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

Unified Diff: runtime/vm/scopes.h

Issue 2419013004: Add local variable declaration token position to service protocol (Closed)
Patch Set: test closure variables Created 4 years, 2 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/scopes.h
diff --git a/runtime/vm/scopes.h b/runtime/vm/scopes.h
index c2fbfe07f720d6ba3d7b6d80a032ca46bf01f5e0..2b676e816af85c000e1fcbd860449faf56d019be 100644
--- a/runtime/vm/scopes.h
+++ b/runtime/vm/scopes.h
@@ -21,10 +21,12 @@ class LocalScope;
class LocalVariable : public ZoneAllocated {
public:
- LocalVariable(TokenPosition token_pos,
+ LocalVariable(TokenPosition declaration_pos,
+ TokenPosition token_pos,
const String& name,
const AbstractType& type)
- : token_pos_(token_pos),
+ : declaration_pos_(declaration_pos),
+ token_pos_(token_pos),
name_(name),
owner_(NULL),
type_(type),
@@ -40,6 +42,7 @@ class LocalVariable : public ZoneAllocated {
}
TokenPosition token_pos() const { return token_pos_; }
+ TokenPosition declaration_token_pos() const { return declaration_pos_; }
const String& name() const { return name_; }
LocalScope* owner() const { return owner_; }
void set_owner(LocalScope* owner) {
@@ -109,6 +112,7 @@ class LocalVariable : public ZoneAllocated {
private:
static const int kUninitializedIndex = INT_MIN;
+ const TokenPosition declaration_pos_;
const TokenPosition token_pos_;
const String& name_;
LocalScope* owner_; // Local scope declaring this variable.

Powered by Google App Engine
This is Rietveld 408576698