WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

34
node_modules/parse-latin/lib/plugin/patch-position.js generated vendored Normal file
View File

@ -0,0 +1,34 @@
'use strict'
var visitChildren = require('unist-util-visit-children')
module.exports = visitChildren(patchPosition)
// Patch the position on a parent node based on its first and last child.
function patchPosition(child, index, node) {
var siblings = node.children
if (!child.position) {
return
}
if (
index === 0 &&
(!node.position || /* istanbul ignore next */ !node.position.start)
) {
patch(node)
node.position.start = child.position.start
}
if (index === siblings.length - 1 && (!node.position || !node.position.end)) {
patch(node)
node.position.end = child.position.end
}
}
// Add a `position` object when it does not yet exist on `node`.
function patch(node) {
if (!node.position) {
node.position = {}
}
}