aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-08 01:46:45 +0200
committerEugen Wissner <belka@caraus.de>2026-10-08 01:46:45 +0200
commitd392f0c54a7748b816ab327758ae835f73cd1c0a (patch)
treea7c029dffab842acbd4f5f0cab5685a93e9b9747 /include
parentd4b7f5e52a33f2d15aafca7f1b040f3f2821fd0c (diff)
downloadelna-d392f0c54a7748b816ab327758ae835f73cd1c0a.tar.gz
Allow initialized declarations without an explicit type
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/ast.h12
1 files changed, 6 insertions, 6 deletions
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<type_expression> m_variable_type;
-
public:
variable_declaration(const source_position position,
- std::vector<identifier_definition>&& identifier, std::shared_ptr<type_expression> variable_type,
- expression *initializer = nullptr);
+ std::vector<identifier_definition>&& identifier, type_expression *variable_type,
+ expression *initializer = nullptr, const bool is_const = false);
variable_declaration(const source_position position,
- std::vector<identifier_definition>&& identifier, std::shared_ptr<type_expression> variable_type,
+ std::vector<identifier_definition>&& identifier, type_expression *variable_type,
std::monostate);
+ ~variable_declaration() override;
void accept(parser_visitor *visitor) override;
bool has_initializer() const;
const std::vector<identifier_definition> 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 };