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

Unified Diff: src/ast/ast.h

Issue 1570793002: [parser] parenthesized Literals are not valid AssignmentPatterns (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO + move ParenthesizedField line above Type-dependent fields/comments 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 | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index a6a6afda5d49003dd6d6c997eb453bec57bd9d0d..32a532a1e250d5c19b384eae0d05091fddb4eba3 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -365,6 +365,14 @@ class Expression : public AstNode {
BailoutId id() const { return BailoutId(local_id(0)); }
TypeFeedbackId test_id() const { return TypeFeedbackId(local_id(1)); }
+ // Parenthesized expressions in the form `( Expression )`.
+ void set_is_parenthesized() {
+ bit_field_ = ParenthesizedField::update(bit_field_, true);
+ }
+ bool is_parenthesized() const {
+ return ParenthesizedField::decode(bit_field_);
+ }
+
protected:
Expression(Zone* zone, int pos)
: AstNode(pos),
@@ -387,6 +395,8 @@ class Expression : public AstNode {
int base_id_;
Bounds bounds_;
class ToBooleanTypesField : public BitField16<uint16_t, 0, 9> {};
+ class ParenthesizedField
+ : public BitField16<bool, ToBooleanTypesField::kNext, 1> {};
uint16_t bit_field_;
// Ends with 16-bit field; deriving classes in turn begin with
// 16-bit fields for optimum packing efficiency.
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698