All files / transform/passes RegisterFunctionDeclaration.js

0% Statements 0/1
100% Branches 0/0
0% Functions 0/2
0% Lines 0/1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49                                                                                                 
import Transformation from '../transformation.js';
import TransformError from '../transformError.js';
import TokenType from '../../parser/vsltokentype';
import t from '../../parser/nodes';
 
import ScopeFuncItem from '../../scope/items/scopeFuncItem';
 
/**
 * Registers a class declaration. Does NOT register any of the child functions
 * or such.
 * 
 * This may call other registrars declared further down the line without this
 * being completed in terms of generation
 */
export default class TypeDeductAssignment extends Transformation {
    constructor() {
        super(t.FunctionStatement, "Register::FunctionDeclaration");
    }
    
    modify(node: Node, tool: ASTTool) {
        // // The root class name (primary associate in scope)
        // let rootId = node.name.identifier.rootId;
        // // The subscope
        // let statements = node.statements;
        
        // // ScopeTypeItems ths can be cast too
        // let castables = []; 
        
        
        // let type = new ScopeTypeItem(
        //     /*rootId:*/ rootId,
        //     /*subscope:*/ node.statements,
        //     {
        //         castables: castables,
        //         isInterface: false
        //     }
        // );
        
        // // Register the type in the parent scope
        // let res = this.parentScope.scope.set(type);
        // if (res === false) {
        //     throw new TransformError(
        //         "Redeclaration of function. This means you have a function " +
        //         "",
        //         node
        //     );
        // }
    }
}