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

Issue 13179002: Add parser support for generators. (Closed)

Created:
7 years, 9 months ago by wingo
Modified:
7 years, 8 months ago
Reviewers:
CC:
Michael Starzinger, rossberg
Base URL:
git://github.com/v8/v8.git@master
Visibility:
Public.

Description

Add parser support for generators. This patchset begins by adding support for "yield", which is unlike other tokens in JS. In a generator, whether strict or classic, it is a syntactic keyword. In classic mode it is an identifier. In strict mode it is reserved. This patch adds YIELD as a token to the scanner, and adapts the preparser and parser appropriately. It also parses "function*", indicating that a function is actually a generator, for both eagerly and lazily parsed functions. Currently "yield" just compiles as "return". BUG= TESTS=Added new test suite for parsing.

Patch Set 1 #

Patch Set 2 : added additional syntax tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+357 lines, -31 lines) Patch
M src/ast.h View 9 chunks +49 lines, -4 lines 0 comments Download
M src/ast.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/flag-definitions.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/full-codegen.cc View 2 chunks +28 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 2 chunks +10 lines, -0 lines 0 comments Download
M src/objects.h View 2 chunks +4 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/parser.h View 3 chunks +4 lines, -0 lines 0 comments Download
M src/parser.cc View 21 chunks +61 lines, -13 lines 0 comments Download
M src/preparser.h View 10 chunks +18 lines, -6 lines 0 comments Download
M src/preparser.cc View 14 chunks +44 lines, -7 lines 0 comments Download
M src/prettyprinter.cc View 2 chunks +11 lines, -0 lines 0 comments Download
M src/scanner.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/scopes.h View 2 chunks +6 lines, -0 lines 0 comments Download
M src/scopes.cc View 3 chunks +21 lines, -0 lines 0 comments Download
M src/token.h View 1 chunk +1 line, -0 lines 0 comments Download
A test/mjsunit/harmony/generators-parsing.js View 1 1 chunk +94 lines, -0 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
wingo
7 years, 9 months ago (2013-03-28 15:27:52 UTC) #1
This is a rebased version of https://codereview.chromium.org/12646003/ with a
better description.  The only change from that CL is resolving a conflict in
flag-definitions.h.  Uploading here so that I can work on trunk for my next
patch that depends on this one.

Powered by Google App Engine
This is Rietveld 408576698