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

Allow definition of global variables using negative values #2660

Closed
grasshopper47 opened this issue Sep 12, 2023 · 0 comments · Fixed by #3698
Closed

Allow definition of global variables using negative values #2660

grasshopper47 opened this issue Sep 12, 2023 · 0 comments · Fixed by #3698
Assignees
Labels
bug Something isn't working

Comments

@grasshopper47
Copy link
Contributor

Aim

Definition of global variables using negative values

global NEGATIVE_1 = -1


Local variables using let work as expected:
image

Expected Behavior

While I can write a 'sausage' like

global NEGATIVE_1 = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000

I'd really-really love to avoid it :)
Sausages work best first in the frying pan, then in my belly 😁

Bug

image

To Reproduce

  1. global NEGATIVE_1 = -1 or any other number

Installation Method

Binary

Nargo Version

0.11.1

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@grasshopper47 grasshopper47 added the bug Something isn't working label Sep 12, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 12, 2023
github-merge-queue bot pushed a commit that referenced this issue Dec 7, 2023
# Description

## Problem\*

Resolves #2660

## Summary\*

Parse negative literals so that they can be used in globals

## Additional Context



## Documentation\*

Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants