/**
 * Copyright (c) 2021-2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

bool IsDynamicLanguage([[maybe_unused]] ark::panda_file::SourceLang lang)
{
    if (lang == ark::SourceLanguage::ETS) {
        return false; //NOLINT(readability-simplify-boolean-expr)
    }

    return false;
}

std::optional<ark::panda_file::SourceLang> LanguageFromString([[maybe_unused]] std::string_view lang)
{
    if (lang == "eTS") {
        return ark::SourceLanguage::ETS;
    }

    if (lang == "PandaAssembly") {
        return ark::panda_file::SourceLang::PANDA_ASSEMBLY;
    }

    return {};
}

const char *LanguageToString([[maybe_unused]] ark::panda_file::SourceLang lang)
{
    if (lang == ark::SourceLanguage::ETS) {
        return "eTS";
    }

    return "PandaAssembly";
}

const char *GetCtorName([[maybe_unused]] ark::panda_file::SourceLang lang)
{
    if (lang == ark::SourceLanguage::ETS) {
        return "<ctor>";
    }

    return ".ctor";
}

const char *GetCctorName([[maybe_unused]] ark::panda_file::SourceLang lang)
{
    if (lang == ark::SourceLanguage::ETS) {
        return "<cctor>";
    }

    return ".cctor";
}

const char *GetStringClassDescriptor([[maybe_unused]] ark::panda_file::SourceLang lang)
{
    if (lang == ark::SourceLanguage::ETS) {
        return "Lstd/core/String;";
    }

    return "Lpanda/String;";
}
