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

Side by Side Diff: src/scopes.h

Issue 13179002: Add parser support for generators. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: added additional syntax tests Created 7 years, 8 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
« no previous file with comments | « src/scanner.cc ('k') | src/scopes.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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 bool outer_scope_calls_non_strict_eval() const { 302 bool outer_scope_calls_non_strict_eval() const {
303 return outer_scope_calls_non_strict_eval_; 303 return outer_scope_calls_non_strict_eval_;
304 } 304 }
305 305
306 // Is this scope inside a with statement. 306 // Is this scope inside a with statement.
307 bool inside_with() const { return scope_inside_with_; } 307 bool inside_with() const { return scope_inside_with_; }
308 // Does this scope contain a with statement. 308 // Does this scope contain a with statement.
309 bool contains_with() const { return scope_contains_with_; } 309 bool contains_with() const { return scope_contains_with_; }
310 310
311 // If this scope is in a function that is a generator.
312 bool inside_generator() const { return scope_inside_generator_; }
313 void set_inside_generator(bool inside) { scope_inside_generator_ = inside; }
314
311 // --------------------------------------------------------------------------- 315 // ---------------------------------------------------------------------------
312 // Accessors. 316 // Accessors.
313 317
314 // The type of this scope. 318 // The type of this scope.
315 ScopeType type() const { return type_; } 319 ScopeType type() const { return type_; }
316 320
317 // The language mode of this scope. 321 // The language mode of this scope.
318 LanguageMode language_mode() const { return language_mode_; } 322 LanguageMode language_mode() const { return language_mode_; }
319 323
320 // The variable corresponding the 'this' value. 324 // The variable corresponding the 'this' value.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 478
475 // Illegal redeclaration. 479 // Illegal redeclaration.
476 Expression* illegal_redecl_; 480 Expression* illegal_redecl_;
477 481
478 // Scope-specific information computed during parsing. 482 // Scope-specific information computed during parsing.
479 // 483 //
480 // This scope is inside a 'with' of some outer scope. 484 // This scope is inside a 'with' of some outer scope.
481 bool scope_inside_with_; 485 bool scope_inside_with_;
482 // This scope contains a 'with' statement. 486 // This scope contains a 'with' statement.
483 bool scope_contains_with_; 487 bool scope_contains_with_;
488 // This scope is in a function that is a generator.
489 bool scope_inside_generator_;
484 // This scope or a nested catch scope or with scope contain an 'eval' call. At 490 // This scope or a nested catch scope or with scope contain an 'eval' call. At
485 // the 'eval' call site this scope is the declaration scope. 491 // the 'eval' call site this scope is the declaration scope.
486 bool scope_calls_eval_; 492 bool scope_calls_eval_;
487 // The language mode of this scope. 493 // The language mode of this scope.
488 LanguageMode language_mode_; 494 LanguageMode language_mode_;
489 // Source positions. 495 // Source positions.
490 int start_position_; 496 int start_position_;
491 int end_position_; 497 int end_position_;
492 498
493 // Computed via PropagateScopeInfo. 499 // Computed via PropagateScopeInfo.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 void SetDefaults(ScopeType type, 634 void SetDefaults(ScopeType type,
629 Scope* outer_scope, 635 Scope* outer_scope,
630 Handle<ScopeInfo> scope_info); 636 Handle<ScopeInfo> scope_info);
631 637
632 Zone* zone_; 638 Zone* zone_;
633 }; 639 };
634 640
635 } } // namespace v8::internal 641 } } // namespace v8::internal
636 642
637 #endif // V8_SCOPES_H_ 643 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/scanner.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698