MyGoInterpreter is a custom programming language interpreter written in Go. The interpreter supports various expressions, control structures, and native functions, providing a foundation for learning about language design and implementation.
- Basic Expressions: Supports arithmetic operations, boolean expressions, and variable assignments.
- Control Structures: Includes if and else statements
- Functions: Allows defining and invoking both user-defined and native functions.
- Native Functions: Provides built-in functions for common operations like printing
let x = 10;
const y = x + 5;
const arr = [1,2,3];
let result = (3 + 4) * 2 - 1;
let isTrue = !false;
let comparison = 10 >= 5;
if (x > 10) {
print("x is greater than 10");
} else {
print("x is less than 10");
}
let i = 0;
while (i < 10) {
println(i)
i = i + 1
}
fn add(a, b) {
a + b
}
print()
println()
//comment