21 lines
575 B
C++
21 lines
575 B
C++
#include "ast.hpp"
|
|
#include "pattern.hpp"
|
|
#include "parser.hpp"
|
|
#include "gmachine.hpp"
|
|
#include "llvm.hpp"
|
|
|
|
int main() {
|
|
try {
|
|
|
|
lily::program_ptr prog = lily::parse(
|
|
"data Bool = { False, True }\n"
|
|
"defn if c t e = { case not c of { True -> { t } False -> { e } } }\n"
|
|
"defn not b = { case b of { True -> { False } False -> { True } } }\n"
|
|
"defn main = { if True 3 2 }"
|
|
);
|
|
prog->gen_llvm();
|
|
} catch(lily::error& e) {
|
|
std::cout << e.message << std::endl;
|
|
}
|
|
}
|