This commit is contained in:
Marvin Schlegel 2024-05-16 11:31:58 +02:00
parent f81a812f59
commit c347e6c630

View File

@ -179,6 +179,9 @@ testStatementIfThenElse = TestCase $
testStatementWhile = TestCase $ testStatementWhile = TestCase $
assertEqual "expect while" [While (Reference "a") (Block [Block []])] $ assertEqual "expect while" [While (Reference "a") (Block [Block []])] $
parseStatement [WHILE,LBRACE,IDENTIFIER "a",RBRACE,LBRACKET,RBRACKET] parseStatement [WHILE,LBRACE,IDENTIFIER "a",RBRACE,LBRACKET,RBRACKET]
testStatementAssign = TestCase $
assertEqual "expect assign 5" [StatementExpressionStatement (Assignment (Reference "a") (IntegerLiteral 5))] $
parseStatement [IDENTIFIER "a",ASSIGN,INTEGERLITERAL 5,SEMICOLON]
@ -233,5 +236,6 @@ tests = TestList [
testExpressionPrecedence, testExpressionPrecedence,
testStatementIfThen, testStatementIfThen,
testStatementIfThenElse, testStatementIfThenElse,
testStatementWhile testStatementWhile,
testStatementAssign
] ]