|
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.
|
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
|
Total messages: 1 (0 generated)
|