function appendText(scope, value) {
  let tail = scope.children[scope.children.length - 1]

  if (!tail || tail.type !== 'text') {
    tail = {type: 'text', value: ''}
    scope.children.push(tail)
  }

  tail.value += value
}
@param {Element | Root} scope
  Node to work in.
@param {string} value
  Text to add.
@returns {undefined}
  Nothing.