Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing support (including incremental parsing) for 'yield' expressions. #1129

Merged
merged 12 commits into from
Nov 14, 2014

Conversation

CyrusNajmabadi
Copy link
Contributor

No description provided.

@CyrusNajmabadi
Copy link
Contributor Author

This CR provides the parsing code for generators/yield-expressions for Fidelity. It also serves as the template/oracle for how we would parse these things in the new parser.

The code handles the normal parsing case, as well as incremental parsing (which is tricky as something like yield(foo) can be parsed in different ways depending on the context).

tests for all of these are at:
CyrusNajmabadi/TypeScript@50f67f1
CyrusNajmabadi/TypeScript@54781f5
CyrusNajmabadi/TypeScript@fad7978

I also recommend looking at this CR one commit at a time.

Also: this CR doesn't deal with the [GeneratorParameter] portion of ES6, or how [Yield] is treated in formal parameters. I need to walk through the grammar entirely to get a good handle on what they're trying to allow/restrict.

// we must have gotten a property name. And if that's all we have, we have to check
// if we have a call signature. If so, then this is a member function, otherwise
// it's a member variable.
if (asterixToken || isCallSignature(/*peekIndex:*/ 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asteriskToken

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh dear. I clearly read too much Asterix and Obelix as a kid.

@CyrusNajmabadi
Copy link
Contributor Author

Adding more tests here:
CyrusNajmabadi@fa7d4b1

@JsonFreeman
Copy link
Contributor

👍

CyrusNajmabadi added a commit that referenced this pull request Nov 14, 2014
Parsing support (including incremental parsing) for 'yield' expressions.
@CyrusNajmabadi CyrusNajmabadi merged commit bc40997 into master Nov 14, 2014
@CyrusNajmabadi CyrusNajmabadi deleted the yieldExpressions branch November 14, 2014 00:44
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants