sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
49 stars 0 forks source link

Support Ranges #293

Open x87 opened 11 months ago

x87 commented 11 months ago

Syntax

Inspired by Rust range syntax: https://doc.rust-lang.org/reference/expressions/range-expr.html

lower bound..upper bound
lower bound..=upper bound
lower bound..
lower bound..=
..upper bound
..=upper bound

.. upper bound is not included in the range ..= upper bound is included in the range

Usage

switch 0@

 case 0, 1.., ..=100, 1000..2000
    //
 case 100..=200
   //
end
for 0@ in 0..100
end

for 0@ in 0..=200
end