GNOME Bugzilla – Bug 781966
Making for loops syntax consistent
Last modified: 2018-05-22 15:49:07 UTC
Created attachment 350758 [details] [review] 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)
Review of attachment 350758 [details] [review]: (In reply to Vladislav from comment #0) > - added Python script to launch tests (because standard "make test" doesn't > support Genie's source files Wouldn't it be better to add genie support to the existing infrastructure than to add a second system? Even if the current system can't be enhanced to support Genie (which seems unlikely), this needs to be integrated with the test target. People aren't likely to manually invoke two separate test systems. I also really don't like the idea of adding a python dependency here… Hardcoding "/home/vlad/Programs/programming/languages/Vala_Genie/valac/installed_v4/bin/valac" isn't good. This should be using the in-tree version of valac, not the system valac and certainly not a hardcoded path that nobody else is likely to have. I haven't actually looked at the changes to valac
@Evan Nemerson, Rico Tzschichholz told that in "valadata" branch test system will change a lot and that I need only to put tests it "test" folder. I made script just to run all tests and to everybody to have ability simply run Genie's tests, there is no need in adding it to master. You can copy-paste it's source text and create your own .py file in the root of Vala's sources and run it. I cannot add Genie support to existing test system - it's written in Bash, I don't know it.
Newer Python script for launching tests (updated to run under Python 3.4): https://github.com/vlad1777d/Genie/blob/genie-improved/run_genie_tests.py
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/585.