ladybird/Userland/Libraries/LibSyntax/Language.h
Sam Atkins ffce6cc977 LibSyntax: Add Language-from-String/Path functions
These are taken from HackStudio, but slightly rearranged to be more
alphabetical, and returning an empty Optional instead of "Unknown".
2023-03-11 13:22:57 +00:00

34 lines
564 B
C++

/*
* Copyright (c) 2020-2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <AK/StringView.h>
namespace Syntax {
enum class Language {
CMake,
CMakeCache,
Cpp,
CSS,
GitCommit,
GML,
HTML,
INI,
JavaScript,
PlainText,
Shell,
SQL,
};
StringView language_to_string(Language);
StringView common_language_extension(Language);
Optional<Language> language_from_name(StringView);
Optional<Language> language_from_filename(LexicalPath const&);
}