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(hurl_core) Add support for underscores in numeric #3482

Closed
wants to merge 2 commits into from

Conversation

0xb-s
Copy link
Contributor

@0xb-s 0xb-s commented Dec 4, 2024

Closes #3475

  • This PR adds support for underscores in numeric literals ) to improve readability in Hurl files.

  • Added tests.

@fabricereix
Copy link
Collaborator

Thanks @0xb-s for your PR.
We probably need to update the AST in order to support this new feature.
When formatting Hurl file, we want to keep any underscore the user has added.

The following Hurl file can be parsed with your changes

GET http://google.fr
[Options]
retry: 1_000

But when formating it with hurlfmt, we lose the underscore.

$ hurlfmt /tmp/test.hurl
GET http://google.fr
[Options]
retry: 1000

@fabricereix
Copy link
Collaborator

We will update the AST and let you know when it is merged, so that you can update your PR.

@0xb-s 0xb-s closed this Dec 10, 2024
@fabricereix
Copy link
Collaborator

Hi @0xb-s
The AST has been updated to keep the original string for both i64 and u64.

pub struct I64 {

You can now update your PR.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support underscore in number literal to increase readability
2 participants