All files / resolver vslGetChild.js

0% Statements 0/5
0% Branches 0/4
0% Functions 0/1
0% Lines 0/5
1 2 3 4 5 6 7 8 9 10 11                     
import t from '../parser/nodes';
import resolvers from './resolvers';
 
export default function vslGetChild(from: Node): TypeResolver {
    switch(from.constructor) {
        case t.ExpressionStatement: return new resolvers.RootResolver(from, vslGetChild);
        case t.Identifier: return new resolvers.IdResolver(from, vslGetChild);
        case t.Literal: return new resolvers.LiteralResolver(from, vslGetChild);
        default: throw new TypeError(`No deduction child handler for ${from.constructor.name}`);
    }
}