-
Notifications
You must be signed in to change notification settings - Fork 123
TOML: improvements #3935
TOML: improvements #3935
Conversation
e16f47d
to
91eadcc
Compare
@markus2330 I have now reverted the comment handling to the state that is described in METADATA.ini. The string handling should be much better now. However, we are still not 100% TOML 1.0.0 compatible. In particular, we cannot parse these valid strings: str1 = """"This," she said, "is just a pointless statement.""""
str2 = ''''That,' she said, 'is still pointless.'''' Other things like the following do work however: str4 = """Here are two quotation marks: "". Simple enough."""
str5 = """Here are three quotation marks: ""\"."""
str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\"."""
quot15 = '''Here are fifteen quotation marks: """""""""""""""''' We should probably add some more tests, but I didn't have time to add many. I also don't really like the way the tests in TEST_WR_HEAD;
WRITE_KEY ("table");
SET_ORDER (0);
SET_TOML_TYPE ("simpletable");
DUP_EXPECTED;
WRITE_KV ("table/b", "123");
SET_ORDER (1);
DUP_EXPECTED;
SET_TYPE ("long_long");
WRITE_KEY ("ta");
SET_ORDER (2);
SET_TOML_TYPE ("tablearray");
DUP_EXPECTED;
SET_ARRAY ("#0");
WRITE_KV ("ta/#0/a", "1337");
SET_ORDER (3);
DUP_EXPECTED;
SET_TYPE ("long_long");
TEST_WR_FOOT; |
This comment has been minimized.
This comment has been minimized.
@markus2330 As far as I'm concerned, this PR can be merged now. You may want to review it first, but the tests suggest that I didn't break anything. I would merge this ASAP and leave any further improvements for follow-up PRs. PS. The failing link-check build job is unrelated to the changes. |
Can you please rebase? |
We now use start conditions in the lexer. This makes everything much more complicated, but it should make the planned metadata support easier. For now, we mostly use start conditions for parsing strings and distinguishing between BARE_STRING and FLOAT tokens. This also changes how comments are parsed and stored.
b5ff427
to
099fec2
Compare
Thank you, amazing work! 💯 |
These examples would be perfect for TOML readme. Please always add information within the code repository. People will not read what we discussed in PRs or issues. |
Agreed. I first thought we would immediately start a follow-up PR, but now that priorities have shifted, we should probably add this to the README. |
TOML is still priority for 1.0 but these cases are probably not keeping us from using it as default? |
I don't think these cases should be a big issue. |
Fixes #3925
Basics
These points need to be fulfilled for every PR:
(added as entry in
doc/news/_preparation_next_release.md
whichcontains
_(my name)_
)Please always add something to the release notes.
(first line should have
module: short statement
syntax)close #X
, are in the commit messages.doc/news/_preparation_next_release.md
scripts/dev/reformat-all
If you have any troubles fulfilling these criteria, please write
about the trouble as comment in the PR. We will help you.
But we cannot accept PRs that do not fulfill the basics.
Checklist
Check relevant points but please do not remove entries.
For docu fixes, spell checking, and similar none of these points below
need to be checked.
(not in the PR description)
Review
Reviewers will usually check the following: