package p.studio.compiler.source.tables;

import p.studio.compiler.source.identifiers.CallableId;
import p.studio.compiler.source.identifiers.ModuleId;

public class CallableTable extends InternTable<CallableId, CallableSignatureRef> implements CallableTableReader {

    public CallableTable() {
        super(CallableId::new);
    }

    public CallableId register(
            final String callableName,
            final int arity,
            final String typeShape) {
        return register(new CallableSignatureRef(ModuleId.none(), callableName, arity, typeShape));
    }

    public CallableId register(
            final ModuleId moduleId,
            final String callableName,
            final int arity,
            final String typeShape) {
        return register(new CallableSignatureRef(moduleId, callableName, arity, typeShape));
    }
}
