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

Side by Side Diff: src/preparser.cc

Issue 573963003: Enable ES6 generators (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.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 #include <cmath> 5 #include <cmath>
6 6
7 #include "include/v8stdint.h" 7 #include "include/v8stdint.h"
8 8
9 #include "src/allocation.h" 9 #include "src/allocation.h"
10 #include "src/base/logging.h" 10 #include "src/base/logging.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 325
326 326
327 PreParser::Statement PreParser::ParseFunctionDeclaration(bool* ok) { 327 PreParser::Statement PreParser::ParseFunctionDeclaration(bool* ok) {
328 // FunctionDeclaration :: 328 // FunctionDeclaration ::
329 // 'function' Identifier '(' FormalParameterListopt ')' '{' FunctionBody '}' 329 // 'function' Identifier '(' FormalParameterListopt ')' '{' FunctionBody '}'
330 // GeneratorDeclaration :: 330 // GeneratorDeclaration ::
331 // 'function' '*' Identifier '(' FormalParameterListopt ')' 331 // 'function' '*' Identifier '(' FormalParameterListopt ')'
332 // '{' FunctionBody '}' 332 // '{' FunctionBody '}'
333 Expect(Token::FUNCTION, CHECK_OK); 333 Expect(Token::FUNCTION, CHECK_OK);
334 int pos = position(); 334 int pos = position();
335 bool is_generator = allow_generators() && Check(Token::MUL); 335 bool is_generator = Check(Token::MUL);
336 bool is_strict_reserved = false; 336 bool is_strict_reserved = false;
337 Identifier name = ParseIdentifierOrStrictReservedWord( 337 Identifier name = ParseIdentifierOrStrictReservedWord(
338 &is_strict_reserved, CHECK_OK); 338 &is_strict_reserved, CHECK_OK);
339 ParseFunctionLiteral(name, scanner()->location(), is_strict_reserved, 339 ParseFunctionLiteral(name, scanner()->location(), is_strict_reserved,
340 is_generator ? FunctionKind::kGeneratorFunction 340 is_generator ? FunctionKind::kGeneratorFunction
341 : FunctionKind::kNormalFunction, 341 : FunctionKind::kNormalFunction,
342 pos, FunctionLiteral::DECLARATION, 342 pos, FunctionLiteral::DECLARATION,
343 FunctionLiteral::NORMAL_ARITY, CHECK_OK); 343 FunctionLiteral::NORMAL_ARITY, CHECK_OK);
344 return Statement::FunctionDeclaration(); 344 return Statement::FunctionDeclaration();
345 } 345 }
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 928 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
929 ParseArguments(ok); 929 ParseArguments(ok);
930 930
931 return Expression::Default(); 931 return Expression::Default();
932 } 932 }
933 933
934 #undef CHECK_OK 934 #undef CHECK_OK
935 935
936 936
937 } } // v8::internal 937 } } // v8::internal
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698