Making for loops syntax consistent
@vlad1777d
Submitted by Vladislav Link to original bug (#781966)
Description
Created attachment 350758 Patch for this
There was difference between "for" loops syntax:
- in case of going through iterable: "for x in iterable_1"
- in case of specifying loops amount with numbers: "for var x = 1 to 10"
Added:
- made consistent case with numbers with case with iterable: "for x in 1 to 10"
- added ability auto-analysis: to increase or decrease loop: "for x in 1...10"
-
- in case when bounds of loop are int numbers - AST is formed using static values
-
- in case when bounds of loop are variable - AST is formed using dynamic expressions
- backported ability of auto-analysis to old "for" loops syntax: "for var x = 1...10")
- added tests for this syntax
- added Python script to launch tests (because standard "make test" doesn't support Genie's source files
Goals:
- make Genie's syntax consistent
- make Genie's syntax to be more similar to other languages (Python, Nim, Coffeescript)
Patch 350758, "Patch for this":
0001-Made-for-loops-syntax-consistent.patch