From d392f0c54a7748b816ab327758ae835f73cd1c0a Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 8 Oct 2026 01:46:45 +0200 Subject: Allow initialized declarations without an explicit type --- include/elna/boot/ast.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/elna/boot/ast.h b/include/elna/boot/ast.h index 35cfc8d..6edeb25 100644 --- a/include/elna/boot/ast.h +++ b/include/elna/boot/ast.h @@ -611,24 +611,24 @@ namespace elna::boot */ class variable_declaration : public declaration { - std::shared_ptr m_variable_type; - public: variable_declaration(const source_position position, - std::vector&& identifier, std::shared_ptr variable_type, - expression *initializer = nullptr); + std::vector&& identifier, type_expression *variable_type, + expression *initializer = nullptr, const bool is_const = false); variable_declaration(const source_position position, - std::vector&& identifier, std::shared_ptr variable_type, + std::vector&& identifier, type_expression *variable_type, std::monostate); + ~variable_declaration() override; void accept(parser_visitor *visitor) override; bool has_initializer() const; const std::vector identifiers; - type_expression& variable_type(); + type_expression *const variable_type{ nullptr }; expression *initializer{ nullptr }; const bool is_extern{ false }; + const bool is_const{ false }; /// Whether the variable was declared in a \c threadvar section. bool is_thread_local{ false }; -- cgit v1.2.3