Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Apply Options configuration rules to parsing #25

Open
11 tasks
Tracked by #14
hrszpuk opened this issue Jun 11, 2024 · 1 comment
Open
11 tasks
Tracked by #14

Apply Options configuration rules to parsing #25

hrszpuk opened this issue Jun 11, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@hrszpuk
Copy link
Owner

hrszpuk commented Jun 11, 2024

The Options.Rules.* need to apply to parsing and the reaction:

  • AllowEmptyValues -> if false then error
  • AllowEmptySections -> if false then error
  • AllowNestedSections -> if false then treat nested sections as 'standard' sections. The nested symbol becomes part of the identifier.
  • AllowSpacesInKeys -> if false then error
  • AllowSpacesInValues -> if false then error
  • AllowDuplicateKeys -> if true then use the last duplicate, if false then error
  • AllowDuplicateSections -> if true then use the last duplicate, if false then error
  • IgnoreCaseSensitivity -> if true then case fold to lowercase
  • IgnoreDelimiterPadding -> if true then any whitespace around the delimiter is ignored, otherwise, if false, it becomes a part of the key/value.
  • IgnoreSectionNamePadding -> if true then any whitespace around the section name is ignored, otherwise, if false, it becomes a part of the section name.
  • IgnoreValueQuotes -> if true then the quotes around values, "value", are ignored (value), otherwise, if false, the quotes become part of the value ("value" will be "value" not value.)
@hrszpuk
Copy link
Owner Author

hrszpuk commented Jun 11, 2024

After going over how these may differ for parsing/serialisation I'm leading towards separating them in the Options struct again. Ah, it is simpler to have the same bool for both parsing and serialisation, but I feel like it might be easy to misinterpret some, and some doing even make sense for both cases (e.g. IgnoreDelimiterPadding doesn't apply to serialisation since it wouldn't ignore something it is generating? ).

@hrszpuk hrszpuk mentioned this issue Jun 12, 2024
11 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant