ParmParse: Add TOML-like features#4950
ParmParse: Add TOML-like features#4950WeiqunZhang wants to merge 8 commits intoAMReX-Codes:developmentfrom
Conversation
|
Note that this PR contains #4944. |
|
Here is a file that can be read by both ParmParse and TOML. |
|
@ax3l, let me know what you think |
|
Re: table header (e.g., [warpx]), right now it will pollute files included with |
|
As for command line, we definitely do not want it affected the tables in inputs files. |
|
Awesome, thank you!! The PR seems to have some commits from #4944, is that intentional? |
|
Yes, it was intentional since this is still a draft. I have rebased the commit on top of #4944 to avoid future conflicts and run the latest clang-tidy. |
For example, suppose we have What do we expect? and Currently, |
|
Yeah, if In practice, at least WarpX CI workflows only include on the top to keep things simple. |
|
This would be useful for our code as well. However, I am still confused about table vs non-table environments. For instance, in this example: does the blank line end the |
|
No it does not. |
|
Right, here are the details: In particular: (1-2 pages scrolling)
Everything else after a table header stays in that header, independent of extra empty newlines. Note that you cannot continue a table in TOML11, but we could allow this in AMReX. TOML:
|
|
Note there is also a cool way to define arrays in TOML, which can be extended, but that is not what we do here for key-value pairs of parm-parse: The arrays are about long or nested list values. |
Yes, we will allow it. For example. |
Add new TOML-like features: - Multi-line string using `"""`. - Array using square brackets. - Table using [table] as header.
|
I have removed #4944 from this PR. It's clean and ready for review now. |
Add new TOML-like features:
""".