Bob/test_fib.bob
Bobby Lucero 72a31b28af Refactor to ExecutionContext pattern and fix string + none concatenation
- Add none value handling to Value::operator+ for string concatenation
- Replace direct string concatenations with Value::operator+ calls in Interpreter
- Add missing string+none and none+string type combinations
- Standardize token literal generation in Lexer
- Add ExecutionContext support across visitor pattern
- Enhance error reporting integration
- Add new standard library functions
2025-08-05 00:49:59 -04:00

18 lines
284 B
Plaintext

var counter = 0;
func fib(n) {
if (n <= 1) {
return n;
}
counter++; // Only increment for recursive calls
return fib(n - 1) + fib(n - 2);
}
print("Fibonacci test:");
var fib_result = fib(30);
print("Result: " + fib_result);
print("Counter: " + counter);