You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from PR #57 review (CommandArg.cs:209): CommandArg.TryGet<T> is one giant
method — a ~400-line if (type == typeof(X)) chain with inline switch cases per
composite type, plus local helper functions. It works (192/192) but is hard to navigate,
and every new type widens the chain.
Proposed shape
Table-driven dispatch: a static Type -> parser delegate map built once and consulted
by TryGet (the RegisteredParsers/StaticProperties/ConstFields/EnumValues
caches already establish the pattern).
Composite-type parsing (Vector2/3/4, Vector2Int/3Int, Color, Quaternion, Rect,
RectInt) moves to per-type parse functions beside the new public CommandArgParsers class, so delimiter/quote handling stays in one place.
Keep public behavior exactly: same accepted formats, same TryGet semantics, same
precedence (per-call parser override -> registered parser -> built-in -> enum ->
named constants). The culture-invariance work in Warnings as errors + built-in analyzers (#55), user-facing changelog (#54) #57 (NumberStyles + InvariantCulture
pinned per type) must survive unchanged, along with the ParsingIsCultureInvariant
PlayMode cases.
No public API change: TryGet, TryGet<T>(parser), RegisterParser, CommandArgParser<T> keep their signatures.
DISCLOSURE: LLM-GENERATED TEXT
Follow-up from PR #57 review (CommandArg.cs:209):
CommandArg.TryGet<T>is one giantmethod — a ~400-line
if (type == typeof(X))chain with inlineswitchcases percomposite type, plus local helper functions. It works (192/192) but is hard to navigate,
and every new type widens the chain.
Proposed shape
Type-> parser delegate map built once and consultedby
TryGet(theRegisteredParsers/StaticProperties/ConstFields/EnumValuescaches already establish the pattern).
RectInt) moves to per-type parse functions beside the new public
CommandArgParsersclass, so delimiter/quote handling stays in one place.TryGetsemantics, sameprecedence (per-call parser override -> registered parser -> built-in -> enum ->
named constants). The culture-invariance work in Warnings as errors + built-in analyzers (#55), user-facing changelog (#54) #57 (NumberStyles + InvariantCulture
pinned per type) must survive unchanged, along with the
ParsingIsCultureInvariantPlayMode cases.
TryGet,TryGet<T>(parser),RegisterParser,CommandArgParser<T>keep their signatures.Acceptance
ParsingIsCultureInvariant, custom-parser cases).
else ifarm (pairs with the built-in-types issue).no boxing in the common path).