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

Side by Side Diff: src/parsing/preparser.h

Issue 2162763003: [parser] Add default constructor for PreParserExpression (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PARSING_PREPARSER_H 5 #ifndef V8_PARSING_PREPARSER_H
6 #define V8_PARSING_PREPARSER_H 6 #define V8_PARSING_PREPARSER_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 explicit PreParserIdentifier(Type type) : type_(type) {} 111 explicit PreParserIdentifier(Type type) : type_(type) {}
112 Type type_; 112 Type type_;
113 113
114 friend class PreParserExpression; 114 friend class PreParserExpression;
115 }; 115 };
116 116
117 117
118 class PreParserExpression { 118 class PreParserExpression {
119 public: 119 public:
120 PreParserExpression() : code_(TypeField::encode(kExpression)) {}
121
120 static PreParserExpression Default() { 122 static PreParserExpression Default() {
121 return PreParserExpression(TypeField::encode(kExpression)); 123 return PreParserExpression();
122 } 124 }
123 125
124 static PreParserExpression Spread(PreParserExpression expression) { 126 static PreParserExpression Spread(PreParserExpression expression) {
125 return PreParserExpression(TypeField::encode(kSpreadExpression)); 127 return PreParserExpression(TypeField::encode(kSpreadExpression));
126 } 128 }
127 129
128 static PreParserExpression FromIdentifier(PreParserIdentifier id) { 130 static PreParserExpression FromIdentifier(PreParserIdentifier id) {
129 return PreParserExpression(TypeField::encode(kIdentifierExpression) | 131 return PreParserExpression(TypeField::encode(kIdentifierExpression) |
130 IdentifierTypeField::encode(id.type_)); 132 IdentifierTypeField::encode(id.type_));
131 } 133 }
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 const PreParserFormalParameters& parameters, FunctionKind kind, 1266 const PreParserFormalParameters& parameters, FunctionKind kind,
1265 FunctionLiteral::FunctionType function_type, bool* ok) { 1267 FunctionLiteral::FunctionType function_type, bool* ok) {
1266 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, 1268 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters,
1267 kind, function_type, ok); 1269 kind, function_type, ok);
1268 } 1270 }
1269 1271
1270 } // namespace internal 1272 } // namespace internal
1271 } // namespace v8 1273 } // namespace v8
1272 1274
1273 #endif // V8_PARSING_PREPARSER_H 1275 #endif // V8_PARSING_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698