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

Hjson: quoteless strings shall not include a comma (#552) #638

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

davidmallasen
Copy link
Member

Replaces #553

Some hjson files in X-HEEP use trailing comma after a "quoteless string"
which isn't valid in the standard (https://hjson.github.io/syntax.html):

> Do not add commas or comments as they would become part of the string.

This includes "barewords" such as `active: low,` but also (surprisingly)
hexadecimal values such as `address: 0x10000000,` which is technically
also interpreted as a string and not an integer value.
(`42,`, `true,`, `false,` and `"string",` are OK though.)

This fixes issue #552.
It also deprecates certain workarounds in the code that were using
`.split(',')` or `.strip(',')` to address this issue (but the issue was
really that the file format was wrong, not that the parser failed).
- Followed by spaces
- There's a commented-out line that has a trailing comma as well
@davidmallasen
Copy link
Member Author

@cousteaulecommandant Can you double-check that the changes here are correct? With that, I'll merge when the CI passes

@cousteaulecommandant
Copy link
Contributor

I can't test it right now (my development computer is in maintenance) but it looks good to me.

@davidmallasen
Copy link
Member Author

No problem, we can wait until you can double-check since this is not blocking (except for your other PR)

@davidmallasen davidmallasen linked an issue Feb 9, 2025 that may be closed by this pull request
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.

Remove trailing commas in hjson files
3 participants