Add initial variable work

This commit is contained in:
2026-04-29 21:20:52 +02:00
parent e2d8e385f0
commit 94ae665a0a
2 changed files with 28 additions and 3 deletions
+26
View File
@@ -62,6 +62,26 @@ typedef struct {
bool is_public;
} AliasDeclaration;
/**
* A declaration of a variable, which may be a constant or not, and may be static or not.
*/
typedef struct {
/** @brief The name of the variable. */
char* name;
/** @brief The type of the variable. */
TypeExpression type;
/** @brief Whether the variable is public or not. */
bool is_public;
/** @brief Whether the variable is static or not. */
bool is_static;
/** @brief Whether the variable is a constant or not. */
bool is_const;
} VariableDeclaration;
/**
* The top-level model.
* Every file matches an entire Module.
@@ -81,6 +101,12 @@ typedef struct {
/** @brief The number of aliases in the module. */
size_t alias_count;
/** @brief The list of variables in the module. */
VariableDeclaration* variables;
/** @brief The number of variables in the module. */
size_t variable_count;
} Module;
#endif