-
Notifications
You must be signed in to change notification settings - Fork 123
TOML spacing #3490
Comments
Thanks, I'm glad it works so well! I will look through all error messages and make them more clear.
I can look into preserving the correct amount of spaces for those. I think I've already an idea on how to solve this without inflating the bison grammar too much/at all (which was my reason for not doing it in the first place).
Yes, strings are currently only written as basic strings. I'll look into this issue in the default storage PR #3478, since the unexpected escaping is causing problems there also.
I'll look into this issue as well, this should already have been supported.
I'll check this out too. I don't think this case is currently handled at all. I will look through all this issues, prioritizing the error messages and mentioning the current gaps to the TOML standard in the readme. |
@bauhaus93 can you update the top-post? Which of these issues are now resolved via the PR that was merged? |
@markus2330 I've updated the top post |
@kodebach is the point " path = 'C:\Users\nodejs\templates'in a TOML file gets after roundtrip rewritten to path = "C:\Users\nodejs\templates" which leads to a parse error." already fixed? |
It should be fixed in #3935. I'll try to finish the PR this week. The code is already there, if you wanna test it. Documentation and tests are still missing, and the handling of comments will change again. We do also validate all string values before writing, so that we never create an invalid TOML file. In the case mentioned here, you will get the literal string Without a If you wanna know more take a look at the code or wait for me to finish the docs. |
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. |
@kodebach which issues here are still open? I remember you fixed many problems with quoting? |
I'd have to check again for the full details, but:
|
Thank you! Is it maybe possible to work on these issues for FLOSS or is the whole lexer/parser too complicated for a new-comer?
I think this is okay. |
I think if someone has prior experience with flex/bison parsing (not unreasonable, considering there are other courses for that), then working on this should be possible. The code is pretty readable IMO and on the TOML side there is a good spec and many examples to show what is allowed and what isn't. There are even some GitHub repos with lots of TOML files for testing parsers. |
I mean #3910. So actually only the spacing issues are left-over here. I don't think this is crucial for having toml as default storage. |
@markus2330 Maybe an issue for the FLOSS course? |
It is a bit difficult to implement and has much lower priority than #3910. |
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. |
I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
I played around with the new TOML plugin and must say it works beyond expectations, it is definitely superior to ini. The only things I noticed so far are some texts in error messages:
and spacing:
=
, see also INI: support not having spaces around = #2065. Ideally, the parser would remember what spaces are around=
and restore it as it was.String quoting seems to be a bit buggy (You will probably catch these things with
kdb test
):path = 'C:\Users\nodejs\templates'
in a TOML file gets after roundtrip rewritten topath = "C:\Users\nodejs\templates"
which leads to a parse error.Some rare features like
1e06
numbers seem to be not supported. (The parser currently thinks it is a bare string.) Imho rather low priority.Something else:
(Btw. I think this example within the TOML spec is broken as another example says that multiple keys with the same name is not allowed.)
I do not think that any of these problems is urgent enough that it must be fixed for the next release. If I could choose something, I think the error messages are the most important thing. It might be good, however, that the current gaps to the TOML standard are documented in the README.md (and which version it should be compliant to.)
So in general I am very positive about this plugin, it greatly improves Elektra 💖 I'll remove the ini plugin, as I am very positive that soon the toml plugin will cover essentially every use case the ini plugin fulfilled but unlike the ini plugin, it will be properly maintained.
The text was updated successfully, but these errors were encountered: