Index: src/parser.h |
diff --git a/src/parser.h b/src/parser.h |
index 5127c84a2e19827c4efc1858138132b26ebaf772..3315b56201de9687b0995464069ea4c725f2ee3e 100644 |
--- a/src/parser.h |
+++ b/src/parser.h |
@@ -536,8 +536,21 @@ class Parser { |
AstNodeFactory<AstConstructionVisitor> factory_; |
}; |
+ class ParsingModeScope BASE_EMBEDDED { |
+ public: |
+ ParsingModeScope(Parser* parser, Mode mode) |
+ : parser_(parser), |
+ old_mode_(parser->mode()) { |
+ parser_->mode_ = mode; |
+ } |
+ ~ParsingModeScope() { |
+ parser_->mode_ = old_mode_; |
+ } |
- |
+ private: |
+ Parser* parser_; |
+ Mode old_mode_; |
+ }; |
FunctionLiteral* ParseLazy(Utf16CharacterStream* source, |
ZoneScope* zone_scope); |