blob: 38e5782b417746b4372ee0b9c7b03aade334844b [file] [log] [blame]
'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)
}