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

feat: Pointer initialization #52

Merged
merged 4 commits into from
Dec 27, 2024
Merged

feat: Pointer initialization #52

merged 4 commits into from
Dec 27, 2024

Conversation

Gashmob
Copy link
Member

@Gashmob Gashmob commented Dec 2, 2024

Closes #51

Introduce new keyword to be able to new i32(25) for example.

Also add pointer dereferencing * and variable address &.

Part of #51

`new` is used to create a pointer to a scalar value
@Gashmob Gashmob added the enhancement New feature or request label Dec 2, 2024
@Gashmob Gashmob added this to the v0.1.0 milestone Dec 2, 2024
@Gashmob Gashmob self-assigned this Dec 2, 2024
@Gashmob Gashmob linked an issue Dec 2, 2024 that may be closed by this pull request
Part of #51

Instead of storing variables in global constant, we now just keep the
value. The value is kept in a context class along building and changed
at assignation. When calling identifier we just get this value directly
Part of #51

By adding * in front a pointer variable you can now access its value:

        val foo = new i32(3);

        *foo // <- returns 3
Part of #51

You can now get address of variable with &
@Gashmob Gashmob merged commit b2e0143 into master Dec 27, 2024
13 checks passed
@Gashmob Gashmob deleted the 51-pointer-initialization branch December 27, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pointer initialization
1 participant