Fix #11: flexible ranges
This commit introduces a more intuitive syntax for ranges,
allowing the user to write [0 .. 4]
or expressions such as:
-
(l[0] + .. + l[len(l) - 1]) / len(l)
to compute the mean ofl
, or -
n * (n - 1) * .. * 1
(to computen!
).
See README.md for more details on the allowed syntax.
The commit contains a large part of refactoring to split values
representation between FrontValue
for values constructed by the
parser, and Value
for "desugared" values, transformed by a
preprocessing phase in ast.rs
. This refactoring opens the way for
introducing other syntactic sugars.
Edited by Thierry Martinez