feat(Attributes): Add unified [<Assignment>]; obsolete the six legacy#315
Open
dimension-zero wants to merge 3 commits into
Open
feat(Attributes): Add unified [<Assignment>]; obsolete the six legacy#315dimension-zero wants to merge 3 commits into
dimension-zero wants to merge 3 commits into
Conversation
* Attributes.fs: New AssignmentAttribute(separator, ?allowSpaced) subsumes CustomAssignment / EqualsAssignment / ColonAssignment / CustomAssignmentOrSpaced / EqualsAssignmentOrSpaced / ColonAssignmentOrSpaced. The legacy six are now marked [<Obsolete>] with a deprecation message pointing at the equivalent [<Assignment(...)>] invocation. Behaviour and storage layout are preserved. * Attributes.fs: Add a file-scoped #nowarn 44 so the legacy attributes that derive from now-obsolete bases (EqualsAssignmentAttribute :> CustomAssignmentAttribute, etc.) still compile inside this file. Callers outside the file still see the obsolete warning. * PreCompute.fs customAssignmentSeparator: read AssignmentAttribute first; if present it wins. Mixing the new attribute with any of the legacy six is rejected with a clear error so we don't have to invent a merge policy. The legacy two-attribute matrix is preserved byte-identical for callers still using it. Strictly additive at the binary level; existing code emits a deprecation warning only.
7 new tests:
* [<Assignment("=")>] parses --port=8080 and rejects spaced --port 8080.
* [<Assignment("=")>] result matches the legacy [<EqualsAssignment>]
parity case.
* [<Assignment(":", allowSpaced = true)>] accepts both --tag:value and
--tag value spaced forms.
* Parity with [<ColonAssignmentOrSpaced>].
* Mixing [<Assignment>] with the legacy [<CustomAssignment>] on the same
case raises a clear ArguException whose message mentions Assignment —
the rejection prevents accidental double-attribution.
The file uses #nowarn 44 because it deliberately exercises the obsolete
legacy attributes alongside the new one. Net suite on this branch:
112 -> 119.
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.
feat(Attributes): Add unified []; obsolete the six legacy
subsumes CustomAssignment / EqualsAssignment / ColonAssignment /
CustomAssignmentOrSpaced / EqualsAssignmentOrSpaced /
ColonAssignmentOrSpaced. The legacy six are now marked []
with a deprecation message pointing at the equivalent
[<Assignment(...)>] invocation. Behaviour and storage layout are
preserved.
that derive from now-obsolete bases (EqualsAssignmentAttribute :>
CustomAssignmentAttribute, etc.) still compile inside this file.
Callers outside the file still see the obsolete warning.
first; if present it wins. Mixing the new attribute with any of the
legacy six is rejected with a clear error so we don't have to invent
a merge policy. The legacy two-attribute matrix is preserved
byte-identical for callers still using it.
Strictly additive at the binary level; existing code emits a
deprecation warning only.
test(AssignmentAttribute): Coverage for unified [] attr
7 new tests:
parity case.
--tag value spaced forms.
case raises a clear ArguException whose message mentions Assignment —
the rejection prevents accidental double-attribution.
The file uses #nowarn 44 because it deliberately exercises the obsolete
legacy attributes alongside the new one. Net suite on this branch:
112 -> 119.