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

Side by Side Diff: src/parsing/rewriter.h

Issue 1481613002: Create ast/ and parsing/ subdirectories and move appropriate files (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years 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
« no previous file with comments | « src/parsing/preparser.cc ('k') | src/parsing/rewriter.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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_REWRITER_H_ 5 #ifndef V8_PARSING_REWRITER_H_
6 #define V8_REWRITER_H_ 6 #define V8_PARSING_REWRITER_H_
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
11 class AstValueFactory; 11 class AstValueFactory;
12 class DoExpression; 12 class DoExpression;
13 class ParseInfo; 13 class ParseInfo;
14 class Parser; 14 class Parser;
15 15
16 class Rewriter { 16 class Rewriter {
17 public: 17 public:
18 // Rewrite top-level code (ECMA 262 "programs") so as to conservatively 18 // Rewrite top-level code (ECMA 262 "programs") so as to conservatively
19 // include an assignment of the value of the last statement in the code to 19 // include an assignment of the value of the last statement in the code to
20 // a compiler-generated temporary variable wherever needed. 20 // a compiler-generated temporary variable wherever needed.
21 // 21 //
22 // Assumes code has been parsed and scopes have been analyzed. Mutates the 22 // Assumes code has been parsed and scopes have been analyzed. Mutates the
23 // AST, so the AST should not continue to be used in the case of failure. 23 // AST, so the AST should not continue to be used in the case of failure.
24 static bool Rewrite(ParseInfo* info); 24 static bool Rewrite(ParseInfo* info);
25 25
26 // Rewrite a list of statements, using the same rules as a top-level program, 26 // Rewrite a list of statements, using the same rules as a top-level program,
27 // to ensure identical behaviour of completion result. 27 // to ensure identical behaviour of completion result.
28 static bool Rewrite(Parser* parser, DoExpression* expr, 28 static bool Rewrite(Parser* parser, DoExpression* expr,
29 AstValueFactory* factory); 29 AstValueFactory* factory);
30 }; 30 };
31 31
32 32
33 } // namespace internal 33 } // namespace internal
34 } // namespace v8 34 } // namespace v8
35 35
36 #endif // V8_REWRITER_H_ 36 #endif // V8_PARSING_REWRITER_H_
OLDNEW
« no previous file with comments | « src/parsing/preparser.cc ('k') | src/parsing/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698