Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support enumeration list #265

Closed
arakov opened this issue Aug 5, 2016 · 2 comments
Closed

Support enumeration list #265

arakov opened this issue Aug 5, 2016 · 2 comments
Assignees
Labels
Design Idea New language feature Feature request New language feature
Milestone

Comments

@arakov
Copy link
Member

arakov commented Aug 5, 2016

Enumeration list (set of named constants) should be supported.

The proposed syntax:

enum Color : enumeration(Red = 1, Blue = 2, Green = 3);

public program()
{
    Color color := Color.Red; 
}
@arakov arakov added Design Idea New language feature Feature request New language feature labels Aug 5, 2016
@arakov arakov added this to the Upcoming release milestone Aug 5, 2016
@arakov
Copy link
Member Author

arakov commented Aug 8, 2016

A special template might be introduced - enum
So for example the following C code

enum { RED, GREEN, /*...*/ WHITE } 

will look in ELENA:

public const struct Color : enum<int>(Red = 1,Green = 2,Blue = 3);

public program()
{
   Color red := Color.Red;
   Color green := Color.Green;
}

@arakov arakov modified the milestones: Upcoming release, ELENA 3.3 Nov 15, 2017
@arakov arakov modified the milestones: ELENA 3.3, ELENA 3.4 Jun 12, 2018
@arakov arakov added this to the ELENA 5.0 milestone Nov 25, 2019
@arakov arakov modified the milestones: ELENA 5.0, ELENA 6.0 Jul 2, 2020
@arakov arakov self-assigned this Jun 26, 2024
arakov added a commit that referenced this issue Jul 2, 2024
arakov added a commit that referenced this issue Jul 4, 2024
[ADDED] #265 : Support enumeration list
arakov added a commit that referenced this issue Jul 4, 2024
@arakov
Copy link
Member Author

arakov commented Jul 4, 2024

Implemented in ELENA 6.2.1

@arakov arakov closed this as completed Jul 4, 2024
@arakov arakov mentioned this issue Jul 9, 2024
arakov added a commit that referenced this issue Jul 9, 2024
* [ADDED] new template extensions'dynamic'Serializer<T>
* [FIXED] String#class.copy[4]
* fixing string.copy constructor
* [FIXED]function attribute is allowed for the function declaration
* [FIXED] template generation routines
* [FIXED] include opcode must restore previous frame value
* [FIXED] JIT code resolving
* fixing elenavm code
* [ADDED] key-value expression
* #265 : working on enumeration template
* [FIXED] private constructor must be called directly
* adding a new unit test
* [FIXED] accessing static fields inside a structure
* [ADDED] #265 : Support enumeration list
* [ADDED] new operator $size
* fixing x86-64 routines
* [FIXED]ppc64le : decoratorTest()
* [ADDED] #658 : new project LDBG - ELENA Debugger Adapter
This was referenced Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Idea New language feature Feature request New language feature
Projects
None yet
Development

No branches or pull requests

1 participant