def _create_fatal_error_node(self, start_pos): """ Creates a non-existing node in the data tree to wrap the content of the error (span) in a node. """ node = ScalarDataNode() end_pos = Position.from_document_end(self._document) node.span = Span(start_pos, end_pos) node.key = TextValue('fatal_error') node.origin = DataNode.Origin.error node.hidden = True self._fatal_error_node = node