A tree-walk interpreter for lox programming language written in Go.
It uses the grammar defined in crafting interpreters book by Rob Nystrom. You can find the grammar here.
Currently, it doesn't support classes but I plan to add them in the future. This is more of a learning project for me than an attempt to create a perfectly working interpreter. I have documented the learning and the process of working of a tree-walk interpreter in this blog.
fun sum(a, b) {
return a + b;
}
print "Hello world";
var a = 1;
if (true) {
print "true";
} else {
print "false";
}
while (condition) {
print "loop";
}
for (var i = 0; i < 10; i = i + 1) {
print i;
}
go run . test.txt