#include "ast.hpp" #include "pattern.hpp" #include "parser.hpp" int main() { try { lily::parse( "data Bool = { True, False }\n" "data Color = { Red, Black }\n" "data IntList = { Nil, Cons(Int, IntList) }\n" "defn other x y = { 3 }\n" "defn add x y = { x + y }\n" "defn ones = { Cons 1 ones }\n" "defn len l = { case l of { Nil -> { 0 } Cons(x, xs) -> { 1 + len xs } } }"); } catch(lily::error& e) { std::cout << e.message << std::endl; } }