Commit 5a6adef
ArgParser: correct map spellability, seen-set scaling, and help syntax
Three follow-ups to the Map support.
Only an unspellable enumerated case is rejected. Enumerated values are
matched with OrdinalIgnoreCase while an entry is split ordinally, so every
casing of a case name is an accepted spelling: a case named `Apple`
survives the separator 'A' because it may be spelled `apple`. The check now
rejects a case only when some character has no casing which avoids the
separators, which is the actual condition for unrepresentability. It also
now considers the separators jointly, so a case named `A` is rejected when
'a' and 'A' are the two separators, though neither alone would do it.
The seen-key set is carried between occurrences. A map with no entry
separator is filled by repeating the argument, and rebuilding the set from
every accumulated key on each occurrence made parsing N entries quadratic.
Each map field now has a persistent-set slot beside its accumulator, seeded
from it in O(1); both are committed only once every entry of the occurrence
has parsed and been found fresh, so a failure partway still leaves the
field untouched.
Help text describes each half of an entry in the syntax that half accepts.
A flag DU is spelled true/false and an enumerated value by case name, so
rendering the raw type left the user guessing: a map now reports e.g.
`map<Severity [one of: Low|High], bool>` rather than `map<Severity,
Enabled>`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 76f887f commit 5a6adef
7 files changed
Lines changed: 532 additions & 77 deletions
File tree
- ConsumePlugin
- WoofWare.Myriad.Plugins.Test/TestArgParser
- WoofWare.Myriad.Plugins
- Test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
40 | 68 | | |
41 | 69 | | |
42 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
229 | 274 | | |
230 | 275 | | |
231 | 276 | | |
| |||
0 commit comments