diff --git a/lib/include/artichoke/Parser/AST/Declarations.hpp b/lib/include/artichoke/Parser/AST/Declarations.hpp index deb2db1..744eb8e 100644 --- a/lib/include/artichoke/Parser/AST/Declarations.hpp +++ b/lib/include/artichoke/Parser/AST/Declarations.hpp @@ -36,7 +36,7 @@ namespace arti::lang::ast { using FunctionParamNode = Ptr; using EnumMemberNode = Ptr; using StructMemberNode = Ptr; - + /* Variant nodes */ using TopLevelDeclNode = Variant< ModuleDeclNode, @@ -81,7 +81,7 @@ namespace arti::lang::ast { String name; Vector genericParams; Vector enumMembers; - }; + }; struct nodes::FunctionDeclaration { SourceLocation location; @@ -121,7 +121,7 @@ namespace arti::lang::ast { String name; Optional type; }; - + struct nodes::GenericParam { SourceLocation location; @@ -130,7 +130,7 @@ namespace arti::lang::ast { struct nodes::FunctionParam { SourceLocation location; - + Boolean isThis; String name; TypeNode type; diff --git a/lib/include/artichoke/Parser/AST/Expressions.hpp b/lib/include/artichoke/Parser/AST/Expressions.hpp index 49c6446..64599d4 100644 --- a/lib/include/artichoke/Parser/AST/Expressions.hpp +++ b/lib/include/artichoke/Parser/AST/Expressions.hpp @@ -153,7 +153,7 @@ namespace arti::lang::ast { struct nodes::ReflectionExpression { SourceLocation location; - String attribute; + Optional attribute; ExpressionNode object; }; diff --git a/lib/include/artichoke/Parser/AST/Statements.hpp b/lib/include/artichoke/Parser/AST/Statements.hpp index 6c30b88..23834a0 100644 --- a/lib/include/artichoke/Parser/AST/Statements.hpp +++ b/lib/include/artichoke/Parser/AST/Statements.hpp @@ -26,7 +26,7 @@ namespace arti::lang::ast { struct WhileStatement; struct DoWhileStatement; struct InfLoopStatement; - struct ExpressionStatement; + struct ExpressionStatement; /* Helper declaration node types */ struct MatchCase; @@ -54,7 +54,7 @@ namespace arti::lang::ast { using ExpressionStmtNode = Ptr; using MatchCaseNode = Ptr; using SwitchCaseNode = Ptr; - + /* Variant nodes */ using StatementNode = Variant< VariableStmtNode, @@ -71,7 +71,7 @@ namespace arti::lang::ast { WhileStmtNode, DoWhileStmtNode, InfLoopStmtNode, - ExpressionStmtNode + ExpressionStmtNode >; using ElseBranchNode = Variant< @@ -88,7 +88,7 @@ namespace arti::lang::ast { VariableStmtNode, ExpressionStmtNode >; - + /* Node definitions */ struct nodes::CodeBlockStatement { @@ -112,7 +112,7 @@ namespace arti::lang::ast { Optional unwrappedVar; ExpressionNode condition; CodeBlockStmtNode body; - ElseBranchNode elseBranch; + Optional elseBranch; }; struct nodes::ElseStatement { @@ -157,7 +157,7 @@ namespace arti::lang::ast { ExpressionNode value; Vector matchCases; - CodeBlockStmtNode defaultCase; + Optional defaultCase; }; struct nodes::SwitchStatement { @@ -165,16 +165,16 @@ namespace arti::lang::ast { ExpressionNode value; Vector switchCases; - CodeBlockStmtNode defaultCase; + Optional defaultCase; }; struct nodes::CForStatement { SourceLocation location; Optional label; - PreLoopStmtNode preLoop; + Optional preLoop; ExpressionNode condition; - ExpressionNode postLoop; + Optional postLoop; CodeBlockStmtNode body; }; @@ -195,7 +195,7 @@ namespace arti::lang::ast { Optional unwrappedVar; ExpressionNode condition; CodeBlockStmtNode body; - ElseBranchNode elseBranch; + Optional elseBranch; }; struct nodes::DoWhileStatement { @@ -218,7 +218,7 @@ namespace arti::lang::ast { ExpressionNode expression; }; - + struct nodes::MatchCase { SourceLocation location;