3 Commits

Author SHA1 Message Date
b99f3586dc
chore(license): Added NOTICE header to all source files
Signed-off-by: erick-alcachofa <erick@artichoke.dev>
2025-12-25 13:12:41 -06:00
9626ac07c8
refactor(AST): Make optional some fields in AST nodes
Signed-off-by: erick-alcachofa <erick@artichoke.dev>

This commit refactors several AST nodes to use `Optional<T>` for fields
that are not always present. This includes `attribute` in
`ReflectionExpression`, `elseBranch` in `IfStatement` and
`WhileStatement`, `defaultCase` in `MatchStatement` and
`SwitchStatement`, and `preLoop` and `postLoop` in `CForStatement`. This
change improves the robustness and clarity of the AST by explicitly
modeling optionality.
2025-10-15 15:58:06 -06:00
c4c3d71cc4
feat(AST): Refactor AST nodes into a multi-file structure
Signed-off-by: erick-alcachofa <erick@artichoke.dev>

This commit refactors the AST (Abstract Syntax Tree) to improve code
organization, clarity, and maintainability. The large single-file AST
definition has been split into multiple, logically grouped header files.

The key changes are:

- **New File Structure**: The single `Node.hpp` file is replaced by a
  modular structure consisting of `Common.hpp`, `Declarations.hpp`,
  `Expressions.hpp`, `Literals.hpp`, `Statements.hpp`, and a new central
  `AST.hpp` header.
- **Improved Naming**: All AST node structs and their aliases have been
  renamed to follow a consistent `[NodeName][NodeType]` convention, such
  as `StructDeclaration` and `StructDeclNode`.
- **Namespace Change**: The `node` namespace has been replaced by
  `arti::lang::ast::nodes` to provide better encapsulation and prevent
  naming conflicts.
- **Type Aliases**: Helper aliases like `String`, `Vector`, and
  `Variant` have been introduced to simplify the code.
2025-10-12 17:40:29 -06:00