Skip to content

Commit

Permalink
Update tests to match revised AST structure for conditional statements
Browse files Browse the repository at this point in the history
  • Loading branch information
bytexenon committed Jun 22, 2024
1 parent 803f894 commit b008648
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions tests/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,28 @@ local expectedAST = {
},
{
TYPE = "IfStatement",
Condition = {
TYPE = "Expression",
Value = { TYPE = "Number", Value = 1 }
},
Codeblock = {
TYPE = "Group",
Branches = {
{
TYPE = "FunctionCall",
Expression = { TYPE = "Variable", VariableType = "Global", Value = "print" },
Arguments = { { TYPE = "Number", Value = 1 } },
ReturnValueAmount = 0
}
},
ElseIfs = {
Condition = {
TYPE = "Expression",
Value = { TYPE = "Number", Value = 1 }
},
CodeBlock = {
TYPE = "Group",
{
TYPE = "FunctionCall",
Expression = { TYPE = "Variable", VariableType = "Global", Value = "print" },
Arguments = { { TYPE = "Number", Value = 1 } },
ReturnValueAmount = 0
}
}
},
{
Condition = {
TYPE = "Expression",
Value = { TYPE = "Number", Value = 2 }
},
Codeblock = {
CodeBlock = {
TYPE = "Group",
{
TYPE = "FunctionCall",
Expand All @@ -176,7 +178,7 @@ local expectedAST = {
}
}
},
ElseCodeblock = {
ElseCodeBlock = {
TYPE = "Group",
{
TYPE = "FunctionCall",
Expand Down

0 comments on commit b008648

Please sign in to comment.