/* * Copyright (c) 2020-2021, the SerenityOS developers. * Copyright (c) 2021-2023, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Web::CSS::Parser { class Block : public RefCounted { public: static NonnullRefPtr create(Token token, Vector&& values) { return adopt_ref(*new Block(move(token), move(values))); } ~Block(); bool is_curly() const { return m_token.is(Token::Type::OpenCurly); } bool is_paren() const { return m_token.is(Token::Type::OpenParen); } bool is_square() const { return m_token.is(Token::Type::OpenSquare); } Token const& token() const { return m_token; } Vector const& values() const { return m_values; } ErrorOr to_string() const; private: Block(Token, Vector&&); Token m_token; Vector m_values; }; }