Allow multiline expressions

This commit is contained in:
James Eversole
2025-01-20 19:20:29 -06:00
parent ca7f09e2ac
commit 35163a5d54
7 changed files with 336 additions and 262 deletions

View File

@ -71,9 +71,9 @@ lexerTests = testGroup "Lexer Tests"
parserTests :: TestTree
parserTests = testGroup "Parser Tests"
[ testCase "Error when assigning a value to T" $ do
let input = lexTricu "t = x"
case (runParser parseExpression "" input) of
Left _ -> return ()
let tokens = lexTricu "t = x"
case parseSingleExpr tokens of
Left _ -> return ()
Right _ -> assertFailure "Expected failure when trying to assign the value of T"
, testCase "Parse function definitions" $ do
let input = "x = (\\a b c : a)"
@ -149,10 +149,6 @@ parserTests = testGroup "Parser Tests"
let input = "(t) -- (t) -- (t)"
expect = [TLeaf]
parseTricu input @?= expect
, testCase "Comments with no terms" $ do
let input = unlines ["-- (t)", "(t t)"]
expect = [SEmpty,SApp TLeaf TLeaf]
parseTricu input @?= expect
]
evaluationTests :: TestTree