Skip to content

createNodeBuilder and associated utility port #791

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
26 changes: 26 additions & 0 deletions internal/ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,10 @@ func (n *Node) AsNotEmittedStatement() *NotEmittedStatement {
return n.data.(*NotEmittedStatement)
}

func (n *Node) AsNotEmittedTypeElement() *NotEmittedTypeElement {
return n.data.(*NotEmittedTypeElement)
}

func (n *Node) AsJSDoc() *JSDoc {
return n.data.(*JSDoc)
}
Expand Down Expand Up @@ -3915,6 +3919,28 @@ func IsNotEmittedStatement(node *Node) bool {
return node.Kind == KindNotEmittedStatement
}

// NotEmittedStatement

// Represents a type element that is elided as part of a transformation to emit comments on a
// not-emitted node.
type NotEmittedTypeElement struct {
NodeBase
TypeElementBase
}

func (f *NodeFactory) NewNotEmittedTypeElement() *Node {
data := &NotEmittedTypeElement{}
return newNode(KindNotEmittedTypeElement, data, f.hooks)
}

func (node *NotEmittedTypeElement) Clone(f *NodeFactory) *Node {
return cloneNode(f.NewNotEmittedTypeElement(), node.AsNode(), f.hooks)
}

func IsNotEmittedTypeElement(node *Node) bool {
return node.Kind == KindNotEmittedTypeElement
}

// ImportEqualsDeclaration

type ImportEqualsDeclaration struct {
Expand Down
1 change: 1 addition & 0 deletions internal/ast/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ const (
KindPartiallyEmittedExpression
KindCommaListExpression
KindSyntheticReferenceExpression
KindNotEmittedTypeElement
// Enum value count
KindCount
// Markers
Expand Down
7 changes: 4 additions & 3 deletions internal/ast/kind_stringer_generated.go

Large diffs are not rendered by default.

Loading