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

Side by Side Diff: src/parsing/parser-base.h

Issue 1643903003: [generators] Desugar yield*. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refer to ResumeMode Created 4 years, 10 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/parsing/parser.cc ('k') | src/parsing/preparser.h » ('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 // 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_PARSING_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/hashmap.h" 10 #include "src/hashmap.h"
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2139 DCHECK_EQ(Yield::kDelegating, kind); 2139 DCHECK_EQ(Yield::kDelegating, kind);
2140 // Delegating yields require an RHS; fall through. 2140 // Delegating yields require an RHS; fall through.
2141 default: 2141 default:
2142 expression = ParseAssignmentExpression(false, classifier, CHECK_OK); 2142 expression = ParseAssignmentExpression(false, classifier, CHECK_OK);
2143 expression = 2143 expression =
2144 Traits::RewriteNonPattern(expression, classifier, CHECK_OK); 2144 Traits::RewriteNonPattern(expression, classifier, CHECK_OK);
2145 break; 2145 break;
2146 } 2146 }
2147 } 2147 }
2148 if (kind == Yield::kDelegating) { 2148 if (kind == Yield::kDelegating) {
2149 // var iterator = subject[Symbol.iterator](); 2149 return Traits::RewriteYieldStar(generator_object, expression, pos);
2150 // Hackily disambiguate o from o.next and o [Symbol.iterator]().
2151 // TODO(verwaest): Come up with a better solution.
2152 expression = this->GetIterator(expression, factory(), pos + 1);
2153 } 2150 }
2154 // Hackily disambiguate o from o.next and o [Symbol.iterator](). 2151 // Hackily disambiguate o from o.next and o [Symbol.iterator]().
2155 // TODO(verwaest): Come up with a better solution. 2152 // TODO(verwaest): Come up with a better solution.
2156 typename Traits::Type::YieldExpression yield = 2153 typename Traits::Type::YieldExpression yield =
2157 factory()->NewYield(generator_object, expression, kind, pos); 2154 factory()->NewYield(generator_object, expression, kind, pos);
2158 return yield; 2155 return yield;
2159 } 2156 }
2160 2157
2161 2158
2162 // Precedence = 3 2159 // Precedence = 3
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 return; 3361 return;
3365 } 3362 }
3366 has_seen_constructor_ = true; 3363 has_seen_constructor_ = true;
3367 return; 3364 return;
3368 } 3365 }
3369 } 3366 }
3370 } // namespace internal 3367 } // namespace internal
3371 } // namespace v8 3368 } // namespace v8
3372 3369
3373 #endif // V8_PARSING_PARSER_BASE_H 3370 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698