Index: src/preparser.h |
diff --git a/src/preparser.h b/src/preparser.h |
index 3d72c97e2691862349b16416591314641ee4695a..cd0a530e8d0bba8b368510601e30ff566a00cb49 100644 |
--- a/src/preparser.h |
+++ b/src/preparser.h |
@@ -77,6 +77,12 @@ class PreParser { |
kFunctionScope |
}; |
+ enum VariableDeclarationContext { |
+ kSourceElement, |
+ kStatement, |
+ kForStatement |
+ }; |
+ |
class Expression; |
class Identifier { |
@@ -344,7 +350,8 @@ class PreParser { |
strict_mode_violation_type_(NULL), |
stack_overflow_(false), |
allow_lazy_(true), |
- parenthesized_function_(false) { } |
+ parenthesized_function_(false), |
+ harmony_block_scoping_(scanner->HarmonyBlockScoping()) { } |
// Preparse the program. Only called in PreParseProgram after creating |
// the instance. |
@@ -377,12 +384,16 @@ class PreParser { |
// which is set to false if parsing failed; it is unchanged otherwise. |
// By making the 'exception handling' explicit, we are forced to check |
// for failure at the call sites. |
+ Statement ParseSourceElement(bool* ok); |
SourceElements ParseSourceElements(int end_token, bool* ok); |
Statement ParseStatement(bool* ok); |
Statement ParseFunctionDeclaration(bool* ok); |
Statement ParseBlock(bool* ok); |
- Statement ParseVariableStatement(bool* ok); |
- Statement ParseVariableDeclarations(bool accept_IN, int* num_decl, bool* ok); |
+ Statement ParseVariableStatement(VariableDeclarationContext var_context, |
+ bool* ok); |
+ Statement ParseVariableDeclarations(VariableDeclarationContext var_context, |
+ int* num_decl, |
+ bool* ok); |
Statement ParseExpressionOrLabelledStatement(bool* ok); |
Statement ParseIfStatement(bool* ok); |
Statement ParseContinueStatement(bool* ok); |
@@ -496,6 +507,7 @@ class PreParser { |
bool stack_overflow_; |
bool allow_lazy_; |
bool parenthesized_function_; |
+ bool harmony_block_scoping_; |
}; |
} } // v8::preparser |