Index: runtime/vm/kernel.h |
diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h |
index 93b828baf7b1e910cbefcb7da5063916b6af7045..8e969411f5b0754eea1d0e787d8659b93869e4f2 100644 |
--- a/runtime/vm/kernel.h |
+++ b/runtime/vm/kernel.h |
@@ -9,6 +9,7 @@ |
#include "platform/assert.h" |
#include "vm/allocation.h" |
#include "vm/globals.h" |
+#include "vm/token_position.h" |
#define KERNEL_NODES_DO(M) \ |
@@ -308,7 +309,7 @@ class StringTable { |
class LineStartingTable { |
public: |
- void ReadFrom(Reader* reader, intptr_t length); |
+ void ReadFrom(Reader* reader); |
void WriteTo(Writer* writer); |
~LineStartingTable() { |
for (intptr_t i = 0; i < size_; ++i) { |
@@ -413,6 +414,7 @@ class Library : public TreeNode { |
virtual void VisitChildren(Visitor* visitor); |
String* import_uri() { return import_uri_; } |
+ intptr_t source_uri_index() { return source_uri_index_; } |
String* name() { return name_; } |
List<Class>& classes() { return classes_; } |
List<Field>& fields() { return fields_; } |
@@ -448,6 +450,7 @@ class Library : public TreeNode { |
Ref<String> name_; |
Ref<String> import_uri_; |
+ intptr_t source_uri_index_; |
List<Class> classes_; |
List<Field> fields_; |
List<Procedure> procedures_; |
@@ -471,6 +474,7 @@ class Class : public TreeNode { |
Library* parent() { return parent_; } |
String* name() { return name_; } |
+ intptr_t source_uri_index() { return source_uri_index_; } |
bool is_abstract() { return is_abstract_; } |
List<Expression>& annotations() { return annotations_; } |
@@ -489,6 +493,7 @@ class Class : public TreeNode { |
Ref<Library> parent_; |
Ref<String> name_; |
+ intptr_t source_uri_index_; |
bool is_abstract_; |
List<Expression> annotations_; |
@@ -629,21 +634,25 @@ class Field : public Member { |
bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } |
bool IsFinal() { return (flags_ & kFlagFinal) == kFlagFinal; } |
bool IsStatic() { return (flags_ & kFlagStatic) == kFlagStatic; } |
+ intptr_t source_uri_index() { return source_uri_index_; } |
DartType* type() { return type_; } |
InferredValue* inferred_value() { return inferred_value_; } |
Expression* initializer() { return initializer_; } |
+ TokenPosition position() { return position_; } |
private: |
- Field() {} |
+ Field() : position_(TokenPosition::kNoSource) {} |
template <typename T> |
friend class List; |
word flags_; |
+ intptr_t source_uri_index_; |
Child<DartType> type_; |
Child<InferredValue> inferred_value_; |
Child<Expression> initializer_; |
+ TokenPosition position_; |
DISALLOW_COPY_AND_ASSIGN(Field); |
}; |
@@ -725,6 +734,7 @@ class Procedure : public Member { |
bool IsAbstract() { return (flags_ & kFlagAbstract) == kFlagAbstract; } |
bool IsExternal() { return (flags_ & kFlagExternal) == kFlagExternal; } |
bool IsConst() { return (flags_ & kFlagConst) == kFlagConst; } |
+ intptr_t source_uri_index() { return source_uri_index_; } |
private: |
Procedure() : kind_(kIncompleteProcedure), flags_(0), function_(NULL) {} |
@@ -734,6 +744,7 @@ class Procedure : public Member { |
ProcedureKind kind_; |
word flags_; |
+ intptr_t source_uri_index_; |
Child<FunctionNode> function_; |
DISALLOW_COPY_AND_ASSIGN(Procedure); |
@@ -934,9 +945,11 @@ class Expression : public TreeNode { |
virtual void AcceptTreeVisitor(TreeVisitor* visitor); |
virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor) = 0; |
+ TokenPosition position() { return position_; } |
protected: |
- Expression() {} |
+ Expression() : position_(TokenPosition::kNoSource) {} |
+ TokenPosition position_; |
private: |
DISALLOW_COPY_AND_ASSIGN(Expression); |
@@ -1281,11 +1294,6 @@ class StaticInvocation : public Expression { |
public: |
static StaticInvocation* ReadFrom(Reader* reader, bool is_const); |
virtual void WriteTo(Writer* writer); |
- |
- explicit StaticInvocation(Procedure* procedure, |
- Arguments* args, |
- bool is_const) |
- : procedure_(procedure), arguments_(args), is_const_(is_const) {} |
~StaticInvocation(); |
virtual void AcceptExpressionVisitor(ExpressionVisitor* visitor); |
@@ -2785,6 +2793,8 @@ class Program : public TreeNode { |
virtual void VisitChildren(Visitor* visitor); |
StringTable& string_table() { return string_table_; } |
+ StringTable& source_uri_table() { return source_uri_table_; } |
+ LineStartingTable& line_starting_table() { return line_starting_table_; } |
List<Library>& libraries() { return libraries_; } |
Procedure* main_method() { return main_method_; } |
@@ -2794,6 +2804,8 @@ class Program : public TreeNode { |
List<Library> libraries_; |
Ref<Procedure> main_method_; |
StringTable string_table_; |
+ StringTable source_uri_table_; |
+ LineStartingTable line_starting_table_; |
DISALLOW_COPY_AND_ASSIGN(Program); |
}; |