sunjay / brain

A high level programming language that compiles into the brainfuck esoteric programming language
MIT License
167 stars 12 forks source link

For Loops and Range Syntax #46

Open sunjay opened 7 years ago

sunjay commented 7 years ago
// The type of i is usize
// i goes from 1 <= i < 10
// This currently must be a static, finite counter
// Variables are not supported as counter limits
// This is basically implemented as a brainfuck loop that goes from
// 0 to (end-start) and start is added to the cell *within* the loop
for i in 1..10 {
    stdout.writeln("i = ", counter);
}