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

Types cleanup #5597

Merged
merged 2 commits into from
Nov 17, 2015
Merged

Types cleanup #5597

merged 2 commits into from
Nov 17, 2015

Conversation

rbuckton
Copy link
Member

Adds explicit interfaces for various syntax kinds, adding some additional restrictions to types whose definition is too broad.

This is needed to support #5595.

export interface EmptyStatement extends Statement { }

// @kind(SyntaxKind.DebuggerStatement)
export interface DebuggerStatement extends Statement { }
Copy link
Member

Choose a reason for hiding this comment

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

Consider adding brands to these.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd rather not litter all of the interfaces with brands. They seem more valuable when disambiguating structurally similar nodes that may not be legally valid in certain parts of the tree (such as LeftHandSideExpression vs Expression).

If we ever end up with Enum type literals, I might change it to:

export interface EmptyStatement extends Statement {
    kind: SyntaxKind.EmptyStatement;
}
...

@DanielRosenwasser
Copy link
Member

👍

export interface DebuggerStatement extends Statement { }

// @kind(SyntaxKind.MissingDeclaration)
// @factoryhidden("name", true)
Copy link
Contributor

Choose a reason for hiding this comment

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

what does facroryhidden and factoryParam mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, meant to remove those.

@mhegazy
Copy link
Contributor

mhegazy commented Nov 12, 2015

👍

rbuckton added a commit that referenced this pull request Nov 17, 2015
@rbuckton rbuckton merged commit 20347ad into master Nov 17, 2015
@rbuckton rbuckton deleted the typesCleanup branch November 17, 2015 18:54
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

4 participants