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

Side by Side Diff: src/preparser.h

Issue 7837028: Let bound iteration variables in for-loops (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 9 years, 2 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 kTopLevelScope, 172 kTopLevelScope,
173 kFunctionScope 173 kFunctionScope
174 }; 174 };
175 175
176 enum VariableDeclarationContext { 176 enum VariableDeclarationContext {
177 kSourceElement, 177 kSourceElement,
178 kStatement, 178 kStatement,
179 kForStatement 179 kForStatement
180 }; 180 };
181 181
182 // If a list of variable declarations includes any initializers.
183 enum VariableDeclarationProperties {
184 kHasInitializers,
185 kHasNoInitializers
186 };
187
182 class Expression; 188 class Expression;
183 189
184 class Identifier { 190 class Identifier {
185 public: 191 public:
186 static Identifier Default() { 192 static Identifier Default() {
187 return Identifier(kUnknownIdentifier); 193 return Identifier(kUnknownIdentifier);
188 } 194 }
189 static Identifier Eval() { 195 static Identifier Eval() {
190 return Identifier(kEvalIdentifier); 196 return Identifier(kEvalIdentifier);
191 } 197 }
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // By making the 'exception handling' explicit, we are forced to check 492 // By making the 'exception handling' explicit, we are forced to check
487 // for failure at the call sites. 493 // for failure at the call sites.
488 Statement ParseSourceElement(bool* ok); 494 Statement ParseSourceElement(bool* ok);
489 SourceElements ParseSourceElements(int end_token, bool* ok); 495 SourceElements ParseSourceElements(int end_token, bool* ok);
490 Statement ParseStatement(bool* ok); 496 Statement ParseStatement(bool* ok);
491 Statement ParseFunctionDeclaration(bool* ok); 497 Statement ParseFunctionDeclaration(bool* ok);
492 Statement ParseBlock(bool* ok); 498 Statement ParseBlock(bool* ok);
493 Statement ParseVariableStatement(VariableDeclarationContext var_context, 499 Statement ParseVariableStatement(VariableDeclarationContext var_context,
494 bool* ok); 500 bool* ok);
495 Statement ParseVariableDeclarations(VariableDeclarationContext var_context, 501 Statement ParseVariableDeclarations(VariableDeclarationContext var_context,
502 VariableDeclarationProperties* decl_props,
496 int* num_decl, 503 int* num_decl,
497 bool* ok); 504 bool* ok);
498 Statement ParseExpressionOrLabelledStatement(bool* ok); 505 Statement ParseExpressionOrLabelledStatement(bool* ok);
499 Statement ParseIfStatement(bool* ok); 506 Statement ParseIfStatement(bool* ok);
500 Statement ParseContinueStatement(bool* ok); 507 Statement ParseContinueStatement(bool* ok);
501 Statement ParseBreakStatement(bool* ok); 508 Statement ParseBreakStatement(bool* ok);
502 Statement ParseReturnStatement(bool* ok); 509 Statement ParseReturnStatement(bool* ok);
503 Statement ParseWithStatement(bool* ok); 510 Statement ParseWithStatement(bool* ok);
504 Statement ParseSwitchStatement(bool* ok); 511 Statement ParseSwitchStatement(bool* ok);
505 Statement ParseDoWhileStatement(bool* ok); 512 Statement ParseDoWhileStatement(bool* ok);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 i::Scanner::Location strict_mode_violation_location_; 613 i::Scanner::Location strict_mode_violation_location_;
607 const char* strict_mode_violation_type_; 614 const char* strict_mode_violation_type_;
608 bool stack_overflow_; 615 bool stack_overflow_;
609 bool allow_lazy_; 616 bool allow_lazy_;
610 bool parenthesized_function_; 617 bool parenthesized_function_;
611 bool harmony_scoping_; 618 bool harmony_scoping_;
612 }; 619 };
613 } } // v8::preparser 620 } } // v8::preparser
614 621
615 #endif // V8_PREPARSER_H 622 #endif // V8_PREPARSER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698