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 776833 - Allow write enumerations values into one line separated by comma
Allow write enumerations values into one line separated by comma
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Genie
0.35.x
Other Linux
: Normal normal
: ---
Assigned To: Jamie McCracken
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-03 18:48 UTC by Vladislav
Modified: 2017-02-17 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to enam (972 bytes, patch)
2017-01-03 18:48 UTC, Vladislav
none Details | Review
genieparser: Allow comma-separated identifiers in definition of enums (2.03 KB, patch)
2017-01-05 11:19 UTC, Rico Tzschichholz
committed Details | Review

Description Vladislav 2017-01-03 18:48:36 UTC
Created attachment 342787 [details] [review]
patch to enam

Sometimes enums take extra place and force paying extra attention on them.
Especially that, which have many values and\or values, which developer can know from reading enum's name and\or several first values.

If add possibility to write enum's values into one line, separating with comma, than this problem will be resolved:
"""
enum TestEnum
	AET, EAT, TEA,
	SS
"""

Also such definition will be valid by compiler, but not recommended from clearness side:
"""
enum TestEnum
	AET = 4, EAT,
	SS = 8
	S =7
	B = 4,
	ZZ = 88  // example of bad declaration
"""

Such approach I took from here: http://nim-lang.org/docs/manual.html#types-enumeration-types

Patch is attached.
Comment 1 Rico Tzschichholz 2017-01-05 11:19:00 UTC
Created attachment 342940 [details] [review]
genieparser: Allow comma-separated identifiers in definition of enums
Comment 2 Vladislav 2017-01-11 14:03:27 UTC
Many thanks, Rico =)
Comment 3 Rico Tzschichholz 2017-02-17 19:50:18 UTC
Attachment 342940 [details] pushed as 4672f73 - genieparser: Allow comma-separated identifiers in definition of enums