Open
Conversation
Collaborator
Author
|
this is where I've got to on a toml parser @jules-ch |
Collaborator
Author
|
I need to set up the tests we do for .txt for .toml too. This is mostly ready for review, with the following things to consider:
|
Collaborator
|
Can we use inline tables, that simplify the toml structure quite a lot. example for prefix: [prefix]
quecto = { value = "1e-30", defined_symbol = "q" }
ronto = { value = "1e-27", defined_symbol = "r" }
yocto = { value = "1e-24", defined_symbol = "y" }
zepto = { value = "1e-21", defined_symbol = "z" }
atto = { value = "1e-18", defined_symbol = "a" }
femto = { value = "1e-15", defined_symbol = "f" }
pico = { value = "1e-12", defined_symbol = "p" }
nano = { value = "1e-9", defined_symbol = "n" }
micro = { value = "1e-6", defined_symbol = "µ", aliases = ["μ", "u", "mu", "mc"] }
milli = { value = "1e-3", defined_symbol = "m" }
centi = { value = "1e-2", defined_symbol = "c" }
deci = { value = "1e-1", defined_symbol = "d" }
deca = { value = "1e+1", defined_symbol = "da", aliases = ["deka"] }
hecto = { value = "1e2", defined_symbol = "h" }
kilo = { value = "1e3", defined_symbol = "k" }
mega = { value = "1e6", defined_symbol = "M" }
giga = { value = "1e9", defined_symbol = "G" }
tera = { value = "1e12", defined_symbol = "T" }
peta = { value = "1e15", defined_symbol = "P" }
exa = { value = "1e18", defined_symbol = "E" }
zetta = { value = "1e21", defined_symbol = "Z" }
yotta = { value = "1e24", defined_symbol = "Y" }
ronna = { value = "1e27", defined_symbol = "R" }
quetta = { value = "1e30", defined_symbol = "Q" }
kibi = { value = "2**10", defined_symbol = "Ki" }
mebi = { value = "2**20", defined_symbol = "Mi" }
gibi = { value = "2**30", defined_symbol = "Gi" }
tebi = { value = "2**40", defined_symbol = "Ti" }
pebi = { value = "2**50", defined_symbol = "Pi" }
exbi = { value = "2**60", defined_symbol = "Ei" }
zebi = { value = "2**70", defined_symbol = "Zi" }
yobi = { value = "2**80", defined_symbol = "Yi" }
semi = { value = "0.5", aliases = ["demi"] }
sesqui = { value = "1.5" } |
Collaborator
Author
looks doable if I swap to tomlkit for writing |
Collaborator
|
For the writer, options are vendoring or specifying an extra dep. Using the writer is only used for serializing a Registry as file no ? We could talk about the toml spec and provide a json schema for linting but that's for another PR I suppose. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pre-commit run --all-fileswith no errors