You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
398 B

'use strict'
module.exports = one
function one(node, parent) {
var self = this
var visitors = self.visitors
// Fail on unknown nodes.
if (typeof visitors[node.type] !== 'function') {
self.file.fail(
new Error(
'Missing compiler for node of type `' + node.type + '`: `' + node + '`'
),
node
)
}
return visitors[node.type].call(self, node, parent)
}