After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781966 - Making for loops syntax consistent
Making for loops syntax consistent
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Genie
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jamie McCracken
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-30 11:53 UTC by Vladislav
Modified: 2018-05-22 15:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for this (27.98 KB, patch)
2017-04-30 11:53 UTC, Vladislav
needs-work Details | Review

Description Vladislav 2017-04-30 11:53:08 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)
Comment 1 Evan Nemerson 2017-04-30 21:39:24 UTC
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
Comment 2 Vladislav 2017-05-01 15:01:32 UTC
@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.
Comment 3 Vladislav 2017-05-06 21:49:26 UTC
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
Comment 4 GNOME Infrastructure Team 2018-05-22 15:49:07 UTC
-- 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.