callHooksForInfoWithFallback(hookMap, info, fallback, defined, ...args) {
		let name;
		if (typeof info === "string") {
			name = info;
		} else {
			if (!(info instanceof VariableInfo)) {
				if (defined !== undefined) {
					return defined();
				}
				return;
			}
			let tagInfo = info.tagInfo;
			while (tagInfo !== undefined) {
				const hook = hookMap.get(tagInfo.tag);
				if (hook !== undefined) {
					this.currentTagData = tagInfo.data;
					const result = hook.call(...args);
					this.currentTagData = undefined;
					if (result !== undefined) return result;
				}
				tagInfo = tagInfo.next;
			}
			if (info.freeName === true) {
				if (defined !== undefined) {
					return defined();
				}
				return;
			}
			name = info.freeName;
		}
		const hook = hookMap.get(name);
		if (hook !== undefined) {
			const result = hook.call(...args);
			if (result !== undefined) return result;
		}
		if (fallback !== undefined) {
			return fallback(/** @type {string} */ (name));
		}
	}
@template T
@template R
@param {HookMap<SyncBailHook<T, R>>} hookMap hooks the should be called
@param {ExportedVariableInfo} info variable info
@param {((name: string) => R | undefined) | undefined} fallback callback when variable in not handled by hooks
@param {((result?: string) => TODO) | undefined} defined callback when variable is defined
@param {AsArray<T>} args args for the hook
@returns {R | undefined} result of hook