1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:37:45 +00:00

Shell: Move AST::create() into the header and use it

This commit is contained in:
AnotherTest 2021-01-03 12:35:06 +03:30 committed by Andreas Kling
parent ef782c805f
commit cdebdaea2d
2 changed files with 13 additions and 13 deletions

View file

@ -41,6 +41,18 @@
namespace Shell::AST {
template<typename T, typename... Args>
static inline NonnullRefPtr<T> create(Args... args)
{
return adopt(*new T(args...));
}
template<typename T>
static inline NonnullRefPtr<T> create(std::initializer_list<NonnullRefPtr<Value>> arg)
{
return adopt(*new T(arg));
}
struct HighlightMetadata {
bool is_first_in_list { true };
};