Open cousteaulecommandant opened 3 months ago
I have created PR #553 to fix the affected hjson files, removing the commas that confuse the hjson parser (but leaving out other commas, although the standard recommends removing those as well).
I have tried to be careful with the latest commit at main
which also touched some of the affected hjson files (including a CI/CD-related file).
Hjson files should not contain commas at the end of each line. In particular, they MUST NOT in the case of "quoteless strings". However, the use of these commas is widespread in X-HEEP, which results in incorrect Hjson files.
Quoting the Hjson documentation:
Furthermore (although less importantly):
However, there are plenty of Hjson files in X-HEEP that use trailing commas, which in many cases are illegal since they will be included as part of the string. The most common cases are "barewords" and hex values starting with
0x
(which are actually strings, not numbers):But I would just remove all the trailing commas, since they're entirely optional (when they're allowed) and the standard itself recommends removing them. This includes trailing commas after a
],
or a},
.This issue seems to have been "fixed" in some places of the Python code by explicitly adding
.strip(',')
, but this is a workaround that "fixes the symptom" rather than fixing the broken file. This can be problematic in a future; I recommend fixing all the .hjson files so that they're compliant with Hjson in this regard.