A bunch more stuffs

This commit is contained in:
2026-08-02 14:09:38 +10:00
parent 437260438c
commit 16846d13bb
7 changed files with 187 additions and 7 deletions

View File

@@ -17,6 +17,9 @@ namespace Solstice {
{TT::Comparison_NotEqual, NodeType::NotEqual},
{TT::Comparison_GreaterThan, NodeType::GreaterThan},
{TT::Comparison_LesserThan, NodeType::LesserThan},
{TT::Assign_Type, NodeType::SetType},
{TT::Assign_Set, NodeType::Set},
{TT::Assign_Bind, NodeType::Bind},
};
std::optional<Literal> Node::getLiteral() const {
@@ -52,6 +55,8 @@ namespace Solstice {
return "Bind";
case NodeType::Set:
return "Set";
case NodeType::SetType:
return "SetType";
case NodeType::Lambda:
return "Lambda";
case NodeType::FunctionCall:
@@ -383,6 +388,11 @@ namespace Solstice {
case TT::Math_Multiply:
case TT::Math_Divide:
return Precedence::Multiply;
case TT::Comparison_Equal:
case TT::Comparison_NotEqual:
case TT::Comparison_GreaterThan:
case TT::Comparison_LesserThan:
return Precedence::Compare;
case TT::Assign_Bind:
case TT::Assign_Set:
case TT::Assign_Type:
@@ -417,6 +427,13 @@ namespace Solstice {
case TT::Math_Subtract:
case TT::Math_Multiply:
case TT::Math_Divide:
case TT::Comparison_Equal:
case TT::Comparison_NotEqual:
case TT::Comparison_GreaterThan:
case TT::Comparison_LesserThan:
case TT::Assign_Set:
case TT::Assign_Bind:
case TT::Assign_Type:
return parseExpr(next->type);
case TT::OpenParen:
return parseOpenParen();

View File

@@ -12,7 +12,7 @@ namespace Solstice {
enum class NodeType {
Root, Literal, Identifier, Expression, Tuple,
CodeBlock,
FunctionBind, Bind, Set,
FunctionBind, Bind, Set, SetType,
Lambda, FunctionCall,
Add, Subtract, Multiply, Divide,
Equal, NotEqual, GreaterThan, LesserThan