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

Unified Diff: src/ast.h

Issue 3120027: Add position information for compares, binary ops, and count (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 4 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 | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
===================================================================
--- src/ast.h (revision 5328)
+++ src/ast.h (working copy)
@@ -1202,11 +1202,17 @@
class BinaryOperation: public Expression {
public:
- BinaryOperation(Token::Value op, Expression* left, Expression* right)
- : op_(op), left_(left), right_(right) {
+ BinaryOperation(Token::Value op,
+ Expression* left,
+ Expression* right,
+ int pos)
+ : op_(op), left_(left), right_(right), pos_(pos) {
ASSERT(Token::IsBinaryOp(op));
}
+ // Create the binary operation corresponding to a compound assignment.
+ explicit BinaryOperation(Assignment* assignment);
+
virtual void Accept(AstVisitor* v);
// Type testing & conversion
@@ -1241,11 +1247,13 @@
Token::Value op() const { return op_; }
Expression* left() const { return left_; }
Expression* right() const { return right_; }
+ int position() const { return pos_; }
private:
Token::Value op_;
Expression* left_;
Expression* right_;
+ int pos_;
};
@@ -1265,13 +1273,14 @@
private:
Token::Value op_;
Expression* expression_;
+ int pos_;
};
class CountOperation: public Expression {
public:
- CountOperation(bool is_prefix, IncrementOperation* increment)
- : is_prefix_(is_prefix), increment_(increment) { }
+ CountOperation(bool is_prefix, IncrementOperation* increment, int pos)
+ : is_prefix_(is_prefix), increment_(increment), pos_(pos) { }
virtual void Accept(AstVisitor* v);
@@ -1287,19 +1296,24 @@
Expression* expression() const { return increment_->expression(); }
IncrementOperation* increment() const { return increment_; }
+ int position() const { return pos_; }
virtual void MarkAsStatement() { is_prefix_ = true; }
private:
bool is_prefix_;
IncrementOperation* increment_;
+ int pos_;
};
class CompareOperation: public Expression {
public:
- CompareOperation(Token::Value op, Expression* left, Expression* right)
- : op_(op), left_(left), right_(right) {
+ CompareOperation(Token::Value op,
+ Expression* left,
+ Expression* right,
+ int pos)
+ : op_(op), left_(left), right_(right), pos_(pos) {
ASSERT(Token::IsCompareOp(op));
}
@@ -1308,6 +1322,7 @@
Token::Value op() const { return op_; }
Expression* left() const { return left_; }
Expression* right() const { return right_; }
+ int position() const { return pos_; }
// Type testing & conversion
virtual CompareOperation* AsCompareOperation() { return this; }
@@ -1316,6 +1331,7 @@
Token::Value op_;
Expression* left_;
Expression* right_;
+ int pos_;
};
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698