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

Add new Datatypes: Structs, Enums and Unions #12

Open
lucalewin opened this issue Apr 3, 2022 · 0 comments
Open

Add new Datatypes: Structs, Enums and Unions #12

lucalewin opened this issue Apr 3, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request feature request
Milestone

Comments

@lucalewin
Copy link
Owner

Features
Add support for struct, enum and union datatypes

Solutions
The syntax of these datatypes should be something like this:

struct Test {
    var number: i64;
    var text: string;
    var character: char;
}
enum Test {
    ENUM_VAR_1,
    ENUM_VAR_2,
    ENUM_VAR_3;
}

The syntax of Unions should be very similar to Structs but they should behave differently

union Test {
    var number: i64;
    var text: string;
    var character: char;
}

Unions and Structs should work like the Structs and Unions in C whereas Enums should work differently.
The variables of an enum should not be globally accessible but accessible with an access expression like Test.ENUM_VAR_1

Additional context
The first version of this could just allocate the memory on the stack.

@lucalewin lucalewin added enhancement New feature or request feature request labels Apr 3, 2022
@lucalewin lucalewin self-assigned this Apr 3, 2022
@lucalewin lucalewin added this to the Version 0.4.0 milestone Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request
Projects
None yet
Development

No branches or pull requests

1 participant