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

Side by Side Diff: src/parser.h

Issue 477263002: ES6: Add support for method shorthand in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« src/ast.h ('K') | « src/objects-inl.h ('k') | src/parser.cc » ('j') | 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_PARSER_H_ 5 #ifndef V8_PARSER_H_
6 #define V8_PARSER_H_ 6 #define V8_PARSER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/compiler.h" // For CachedDataMode 10 #include "src/compiler.h" // For CachedDataMode
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 578
579 // Utility functions 579 // Utility functions
580 int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope, 580 int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope,
581 Scanner::Location* dupe_loc, 581 Scanner::Location* dupe_loc,
582 bool* ok); 582 bool* ok);
583 V8_INLINE AstValueFactory* ast_value_factory(); 583 V8_INLINE AstValueFactory* ast_value_factory();
584 584
585 // Temporary glue; these functions will move to ParserBase. 585 // Temporary glue; these functions will move to ParserBase.
586 Expression* ParseV8Intrinsic(bool* ok); 586 Expression* ParseV8Intrinsic(bool* ok);
587 FunctionLiteral* ParseFunctionLiteral( 587 FunctionLiteral* ParseFunctionLiteral(
588 const AstRawString* name, 588 const AstRawString* name, Scanner::Location function_name_location,
589 Scanner::Location function_name_location,
590 bool name_is_strict_reserved, 589 bool name_is_strict_reserved,
591 bool is_generator, 590 FunctionLiteral::IsGeneratorFlag is_generator,
592 int function_token_position, 591 FunctionLiteral::IsArrowFlag is_arrow,
593 FunctionLiteral::FunctionType type, 592 FunctionLiteral::IsConciseMethodFlag is_concise_method,
594 FunctionLiteral::ArityRestriction arity_restriction, 593 int function_token_position, FunctionLiteral::FunctionType type,
595 bool* ok); 594 FunctionLiteral::ArityRestriction arity_restriction, bool* ok);
596 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name, 595 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name,
597 int* materialized_literal_count, 596 int* materialized_literal_count,
598 int* expected_property_count, bool* ok); 597 int* expected_property_count, bool* ok);
599 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( 598 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody(
600 const AstRawString* name, int pos, Variable* fvar, 599 const AstRawString* name, int pos, Variable* fvar,
601 Token::Value fvar_init_op, bool is_generator, bool* ok); 600 Token::Value fvar_init_op, bool is_generator, bool* ok);
602 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, 601 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope,
603 bool* ok); 602 bool* ok);
604 603
605 private: 604 private:
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 void InitializeForEachStatement(ForEachStatement* stmt, 738 void InitializeForEachStatement(ForEachStatement* stmt,
740 Expression* each, 739 Expression* each,
741 Expression* subject, 740 Expression* subject,
742 Statement* body); 741 Statement* body);
743 Statement* DesugarLetBindingsInForStatement( 742 Statement* DesugarLetBindingsInForStatement(
744 Scope* inner_scope, ZoneList<const AstRawString*>* names, 743 Scope* inner_scope, ZoneList<const AstRawString*>* names,
745 ForStatement* loop, Statement* init, Expression* cond, Statement* next, 744 ForStatement* loop, Statement* init, Expression* cond, Statement* next,
746 Statement* body, bool* ok); 745 Statement* body, bool* ok);
747 746
748 FunctionLiteral* ParseFunctionLiteral( 747 FunctionLiteral* ParseFunctionLiteral(
749 const AstRawString* name, 748 const AstRawString* name, Scanner::Location function_name_location,
750 Scanner::Location function_name_location,
751 bool name_is_strict_reserved, 749 bool name_is_strict_reserved,
752 bool is_generator, 750 FunctionLiteral::IsGeneratorFlag is_generator,
753 int function_token_position, 751 FunctionLiteral::IsArrowFlag is_arrow,
754 FunctionLiteral::FunctionType type, 752 FunctionLiteral::IsConciseMethodFlag is_concise_method,
755 FunctionLiteral::ArityRestriction arity_restriction, 753 int function_token_position, FunctionLiteral::FunctionType type,
756 bool* ok); 754 FunctionLiteral::ArityRestriction arity_restriction, bool* ok);
757 755
758 // Magical syntax support. 756 // Magical syntax support.
759 Expression* ParseV8Intrinsic(bool* ok); 757 Expression* ParseV8Intrinsic(bool* ok);
760 758
761 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); 759 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode);
762 760
763 // Get odd-ball literals. 761 // Get odd-ball literals.
764 Literal* GetLiteralUndefined(int position); 762 Literal* GetLiteralUndefined(int position);
765 763
766 // For harmony block scoping mode: Check if the scope has conflicting var/let 764 // For harmony block scoping mode: Check if the scope has conflicting var/let
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 private: 901 private:
904 static const int kLiteralTypeSlot = 0; 902 static const int kLiteralTypeSlot = 0;
905 static const int kElementsSlot = 1; 903 static const int kElementsSlot = 1;
906 904
907 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 905 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
908 }; 906 };
909 907
910 } } // namespace v8::internal 908 } } // namespace v8::internal
911 909
912 #endif // V8_PARSER_H_ 910 #endif // V8_PARSER_H_
OLDNEW
« src/ast.h ('K') | « src/objects-inl.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698