mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
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".
This commit is contained in:
parent
82f58b8af0
commit
ffce6cc977
2 changed files with 69 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
namespace Syntax {
|
||||
|
@ -27,5 +28,7 @@ enum class Language {
|
|||
|
||||
StringView language_to_string(Language);
|
||||
StringView common_language_extension(Language);
|
||||
Optional<Language> language_from_name(StringView);
|
||||
Optional<Language> language_from_filename(LexicalPath const&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue