nl_tokens: Returns true if this node is missing from the actual source code . A missing node is different from undefined / defined . When a node is undefined ( which can happen for optional nodes in the tree ) it is definitely missing . However a node may be defined but still be missing . This happens whenever the parser knows it needs to parse something but can t get anything in the source code that it expects at that location . For example : let a : ; Here the Type in the Type - Annotation is not - optional ( as there is a colon in the source code ) . So the parser will attempt to parse out a type and will create an actual node . However this node will be missing in the sense that no actual source - code / tokens are contained within it .
pl_tokens: function nodeIsMissing ( node ) { if ( ! node ) { return <mask> ; } return node . pos === node . end && node . pos >= 0 && node . kind !== 1 /* EndOfFileToken */ ; }