MCPcopy Create free account
hub / github.com/microsoft/typescript-go / IsDeclarationStatement

Function IsDeclarationStatement

internal/ast/utilities.go:653–655  ·  view source on GitHub ↗

Determines whether a node is a DeclarationStatement. Ideally this does not use Parent pointers, but it may use them to rule out a Block node that is part of `try` or `catch` or is the Block-like body of a function. NOTE: ECMA262 would just call this a Declaration

(node *Node)

Source from the content-addressed store, hash-verified

651//
652// NOTE: ECMA262 would just call this a Declaration
653func IsDeclarationStatement(node *Node) bool {
654 return isDeclarationStatementKind(node.Kind)
655}
656
657func isStatementKindButNotDeclarationKind(kind Kind) bool {
658 switch kind {

Callers 1

Calls 1

Tested by

no test coverage detected