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

Side by Side Diff: src/parser.h

Issue 9460064: Further refactoring of declarations in the AST: (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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/hydrogen.cc ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 void ReportMessage(const char* message, Vector<const char*> args); 559 void ReportMessage(const char* message, Vector<const char*> args);
560 560
561 bool inside_with() const { return top_scope_->inside_with(); } 561 bool inside_with() const { return top_scope_->inside_with(); }
562 Scanner& scanner() { return scanner_; } 562 Scanner& scanner() { return scanner_; }
563 Mode mode() const { return mode_; } 563 Mode mode() const { return mode_; }
564 ScriptDataImpl* pre_data() const { return pre_data_; } 564 ScriptDataImpl* pre_data() const { return pre_data_; }
565 bool is_extended_mode() { 565 bool is_extended_mode() {
566 ASSERT(top_scope_ != NULL); 566 ASSERT(top_scope_ != NULL);
567 return top_scope_->is_extended_mode(); 567 return top_scope_->is_extended_mode();
568 } 568 }
569 Scope* DeclarationScope(VariableMode mode) {
570 return (mode == LET || mode == CONST_HARMONY)
571 ? top_scope_ : top_scope_->DeclarationScope();
572 }
569 573
570 // Check if the given string is 'eval' or 'arguments'. 574 // Check if the given string is 'eval' or 'arguments'.
571 bool IsEvalOrArguments(Handle<String> string); 575 bool IsEvalOrArguments(Handle<String> string);
572 576
573 // All ParseXXX functions take as the last argument an *ok parameter 577 // All ParseXXX functions take as the last argument an *ok parameter
574 // which is set to false if parsing failed; it is unchanged otherwise. 578 // which is set to false if parsing failed; it is unchanged otherwise.
575 // By making the 'exception handling' explicit, we are forced to check 579 // By making the 'exception handling' explicit, we are forced to check
576 // for failure at the call sites. 580 // for failure at the call sites.
577 void* ParseSourceElements(ZoneList<Statement*>* processor, 581 void* ParseSourceElements(ZoneList<Statement*>* processor,
578 int end_token, bool* ok); 582 int end_token, bool* ok);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 // 753 //
750 // function f() { { { var x; } let x; } } 754 // function f() { { { var x; } let x; } }
751 // function g() { { var x; let x; } } 755 // function g() { { var x; let x; } }
752 // 756 //
753 // The var declarations are hoisted to the function scope, but originate from 757 // The var declarations are hoisted to the function scope, but originate from
754 // a scope where the name has also been let bound or the var declaration is 758 // a scope where the name has also been let bound or the var declaration is
755 // hoisted over such a scope. 759 // hoisted over such a scope.
756 void CheckConflictingVarDeclarations(Scope* scope, bool* ok); 760 void CheckConflictingVarDeclarations(Scope* scope, bool* ok);
757 761
758 // Parser support 762 // Parser support
759 VariableProxy* Declare(Handle<String> name, VariableMode mode, 763 VariableProxy* NewUnresolved(Handle<String> name, VariableMode mode);
760 FunctionLiteral* fun, 764 void Declare(Declaration* declaration, bool resolve, bool* ok);
761 bool resolve,
762 bool* ok);
763 765
764 bool TargetStackContainsLabel(Handle<String> label); 766 bool TargetStackContainsLabel(Handle<String> label);
765 BreakableStatement* LookupBreakTarget(Handle<String> label, bool* ok); 767 BreakableStatement* LookupBreakTarget(Handle<String> label, bool* ok);
766 IterationStatement* LookupContinueTarget(Handle<String> label, bool* ok); 768 IterationStatement* LookupContinueTarget(Handle<String> label, bool* ok);
767 769
768 void RegisterTargetUse(Label* target, Target* stop); 770 void RegisterTargetUse(Label* target, Target* stop);
769 771
770 // Factory methods. 772 // Factory methods.
771 773
772 Scope* NewScope(Scope* parent, ScopeType type); 774 Scope* NewScope(Scope* parent, ScopeType type);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 private: 858 private:
857 static const int kTypeSlot = 0; 859 static const int kTypeSlot = 0;
858 static const int kElementsSlot = 1; 860 static const int kElementsSlot = 1;
859 861
860 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 862 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
861 }; 863 };
862 864
863 } } // namespace v8::internal 865 } } // namespace v8::internal
864 866
865 #endif // V8_PARSER_H_ 867 #endif // V8_PARSER_H_
OLDNEW
« src/ast.h ('K') | « src/hydrogen.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698