Chromium Code Reviews| Index: src/parsing/parser.h |
| diff --git a/src/parsing/parser.h b/src/parsing/parser.h |
| index 9bb92e840899c2b21e1ad51ee16aacf6427ecc5c..f520de68d310cdb1a4fe865b7bd9c3e01256bda0 100644 |
| --- a/src/parsing/parser.h |
| +++ b/src/parsing/parser.h |
| @@ -494,49 +494,25 @@ class ParserTraits { |
| Expression* NewThrowTypeError(MessageTemplate::Template message, |
| const AstRawString* arg, int pos); |
| - // Generic AST generator for throwing errors from compiled code. |
| - Expression* NewThrowError(Runtime::FunctionId function_id, |
| - MessageTemplate::Template message, |
| - const AstRawString* arg, int pos); |
| - |
| - void FinalizeIteratorUse(Variable* completion, Expression* condition, |
| - Variable* iter, Block* iterator_use, Block* result); |
| - |
| - Statement* FinalizeForOfStatement(ForOfStatement* loop, Variable* completion, |
| - int pos); |
| - |
| // Reporting errors. |
| void ReportMessageAt(Scanner::Location source_location, |
| MessageTemplate::Template message, |
| const char* arg = NULL, |
| ParseErrorType error_type = kSyntaxError); |
| - void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, |
| - ParseErrorType error_type = kSyntaxError); |
| - void ReportMessage(MessageTemplate::Template message, const AstRawString* arg, |
| - ParseErrorType error_type = kSyntaxError); |
| void ReportMessageAt(Scanner::Location source_location, |
| MessageTemplate::Template message, |
| const AstRawString* arg, |
| ParseErrorType error_type = kSyntaxError); |
| // "null" return type creators. |
| - static const AstRawString* EmptyIdentifier() { |
| - return NULL; |
| - } |
| - static Expression* EmptyExpression() { |
| - return NULL; |
| - } |
| - static Literal* EmptyLiteral() { |
| - return NULL; |
| - } |
| + static const AstRawString* EmptyIdentifier() { return NULL; } |
|
marja
2016/08/18 08:36:15
If you're anyway modifying this line, you could ch
nickie
2016/08/18 09:14:03
Done.
|
| + static Expression* EmptyExpression() { return NULL; } |
| + static Literal* EmptyLiteral() { return NULL; } |
| static ObjectLiteralProperty* EmptyObjectLiteralProperty() { return NULL; } |
| static FunctionLiteral* EmptyFunctionLiteral() { return NULL; } |
| // Used in error return values. |
| - static ZoneList<Expression*>* NullExpressionList() { |
| - return NULL; |
| - } |
| - static const AstRawString* EmptyFormalParameter() { return NULL; } |
| + static ZoneList<Expression*>* NullExpressionList() { return NULL; } |
| // Non-NULL empty string. |
| V8_INLINE const AstRawString* EmptyIdentifierString(); |
| @@ -581,10 +557,6 @@ class ParserTraits { |
| ZoneList<Statement*>* body, bool accept_IN, |
| Type::ExpressionClassifier* classifier, int pos, bool* ok); |
| - V8_INLINE Scope* NewScope(ScopeType scope_type); |
| - V8_INLINE DeclarationScope* NewFunctionScope(FunctionKind kind); |
| - V8_INLINE Scope* NewScopeWithParent(Scope* parent, ScopeType scope_type); |
| - |
| V8_INLINE void AddFormalParameter(ParserFormalParameters* parameters, |
| Expression* pattern, |
| Expression* initializer, |
| @@ -593,9 +565,6 @@ class ParserTraits { |
| DeclarationScope* scope, |
| const ParserFormalParameters::Parameter& parameter, |
| Type::ExpressionClassifier* classifier); |
| - void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters, |
| - Expression* params, int end_pos, |
| - bool* ok); |
| void ParseArrowFunctionFormalParameterList( |
| ParserFormalParameters* parameters, Expression* params, |
| const Scanner::Location& params_loc, Scanner::Location* duplicate_loc, |
| @@ -631,8 +600,7 @@ class ParserTraits { |
| V8_INLINE void MarkCollectedTailCallExpressions(); |
| V8_INLINE void MarkTailPosition(Expression* expression); |
| - V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, |
| - bool* ok); |
| + V8_INLINE void CheckConflictingVarDeclarations(Scope* scope, bool* ok); |
| class TemplateLiteral : public ZoneObject { |
| public: |
| @@ -707,7 +675,6 @@ class ParserTraits { |
| void SetFunctionNameFromIdentifierRef(Expression* value, |
| Expression* identifier); |
| - void SetFunctionName(Expression* value, const AstRawString* name); |
| // Rewrite expressions that are not used as patterns |
| V8_INLINE void RewriteNonPattern(Type::ExpressionClassifier* classifier, |
| @@ -719,18 +686,11 @@ class ParserTraits { |
| V8_INLINE ZoneList<Expression*>* GetNonPatternList() const; |
| - Expression* RewriteYieldStar( |
| - Expression* generator, Expression* expression, int pos); |
| + V8_INLINE Expression* RewriteYieldStar(Expression* generator, |
| + Expression* expression, int pos); |
| private: |
| Parser* parser_; |
| - |
| - void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, |
| - Variable* input, Variable* output); |
| - void BuildIteratorCloseForCompletion(ZoneList<Statement*>* statements, |
| - Variable* iterator, |
| - Expression* completion); |
| - Statement* CheckCallable(Variable* var, Expression* error, int pos); |
| }; |
| @@ -1175,6 +1135,31 @@ class Parser : public ParserBase<ParserTraits> { |
| Expression* BuildPromiseResolve(Expression* value, int pos); |
| Expression* BuildPromiseReject(Expression* value, int pos); |
| + // Generic AST generator for throwing errors from compiled code. |
| + Expression* NewThrowError(Runtime::FunctionId function_id, |
| + MessageTemplate::Template message, |
| + const AstRawString* arg, int pos); |
| + |
| + void FinalizeIteratorUse(Variable* completion, Expression* condition, |
| + Variable* iter, Block* iterator_use, Block* result); |
| + |
| + Statement* FinalizeForOfStatement(ForOfStatement* loop, Variable* completion, |
| + int pos); |
| + void BuildIteratorClose(ZoneList<Statement*>* statements, Variable* iterator, |
| + Variable* input, Variable* output); |
| + void BuildIteratorCloseForCompletion(ZoneList<Statement*>* statements, |
| + Variable* iterator, |
| + Expression* completion); |
| + Statement* CheckCallable(Variable* var, Expression* error, int pos); |
| + |
| + Expression* RewriteYieldStar(Expression* generator, Expression* expression, |
| + int pos); |
| + |
| + void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters, |
| + Expression* params, int end_pos, |
| + bool* ok); |
| + void SetFunctionName(Expression* value, const AstRawString* name); |
| + |
| Scanner scanner_; |
| PreParser* reusable_preparser_; |
| Scope* original_scope_; // for ES5 function declarations in sloppy eval |
| @@ -1203,18 +1188,6 @@ bool ParserTraits::IsFutureStrictReserved( |
| return parser_->scanner()->IdentifierIsFutureStrictReserved(identifier); |
| } |
| -Scope* ParserTraits::NewScopeWithParent(Scope* parent, ScopeType scope_type) { |
| - return parser_->NewScopeWithParent(parent, scope_type); |
| -} |
| - |
| -Scope* ParserTraits::NewScope(ScopeType scope_type) { |
| - return parser_->NewScope(scope_type); |
| -} |
| - |
| -DeclarationScope* ParserTraits::NewFunctionScope(FunctionKind kind) { |
| - return parser_->NewFunctionScope(kind); |
| -} |
| - |
| const AstRawString* ParserTraits::EmptyIdentifierString() { |
| return parser_->ast_value_factory()->empty_string(); |
| } |
| @@ -1235,9 +1208,7 @@ ZoneList<Statement*>* ParserTraits::ParseEagerFunctionBody( |
| function_type, ok); |
| } |
| - |
| -void ParserTraits::CheckConflictingVarDeclarations(v8::internal::Scope* scope, |
| - bool* ok) { |
| +void ParserTraits::CheckConflictingVarDeclarations(Scope* scope, bool* ok) { |
| parser_->CheckConflictingVarDeclarations(scope, ok); |
| } |
| @@ -1379,6 +1350,10 @@ DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
| return parser_->ParseDoExpression(ok); |
| } |
| +Expression* ParserTraits::RewriteYieldStar(Expression* generator, |
| + Expression* iterable, int pos) { |
| + return parser_->RewriteYieldStar(generator, iterable, pos); |
| +} |
| } // namespace internal |
| } // namespace v8 |