Dot operation with set notation #3

Open
opened 2025-10-11 02:23:30 +00:00 by UserCurt · 2 comments
UserCurt commented 2025-10-11 02:23:30 +00:00 (Migrated from codeberg.org)

This feature request is to incorporate another means of matching multiple fields while being explicit in which fields those are as this is not currently possible. This is proposed through the usage of sets of fields. In the simplest form, this will be done by listing the field names within brace notation, /{A,B,C} with each field delimited by a comma. This can be combined with dimension specifiers, like in /{A,B,C}#2.

In the more general case, elements in this set can be nearly any kind of dot operation, like glob fields, quoted field strings, or regular expression strings. For example, these would be valid dot operations with set notation: /{A*, B?}, /{"x,y", ~"q.*p"}.

Some open questions:

  • What should happen if at least one DotExact element within the set does not match any field?
  • What should happen if at least one element of a multi-matching dot operation within the set does not match any field?
  • What should happen if multiple elements within the set match the same field? Should they be repeated, or should the union be taken?

Some of these may interact with the NullFields named argument.

This issue may be promoted to an earlier release if these open questions can be satisfactorily addressed.

This feature request is to incorporate another means of matching multiple fields while being explicit in which fields those are as this is not currently possible. This is proposed through the usage of sets of fields. In the simplest form, this will be done by listing the field names within brace notation, `/{A,B,C}` with each field delimited by a comma. This can be combined with dimension specifiers, like in `/{A,B,C}#2`. In the more general case, elements in this set can be nearly any kind of dot operation, like glob fields, quoted field strings, or regular expression strings. For example, these would be valid dot operations with set notation: `/{A*, B?}`, `/{"x,y", ~"q.*p"}`. Some open questions: - What should happen if at least one DotExact element within the set does not match any field? - What should happen if at least one element of a multi-matching dot operation within the set does not match any field? - What should happen if multiple elements within the set match the same field? Should they be repeated, or should the union be taken? Some of these may interact with the `NullFields` named argument. This issue may be promoted to an earlier release if these open questions can be satisfactorily addressed.
UserCurt commented 2025-10-11 02:26:44 +00:00 (Migrated from codeberg.org)

Usage of bracket syntax should be considered to unify the syntax with concatenation described in issue #2. A few examples:

  • /[A, B, C]
  • /[A, B, C]#2
  • /[A*, B?]
  • /["x,y", ~"q.*p"]
Usage of bracket syntax should be considered to unify the syntax with concatenation described in issue #2. A few examples: - `/[A, B, C]` - `/[A, B, C]#2` - `/[A*, B?]` - `/["x,y", ~"q.*p"]`
UserCurt commented 2026-07-02 08:53:55 +00:00 (Migrated from codeberg.org)

This issue has been partially implemented. Currently, set-style dot operations are implemented but only for DotExact operations, for example /{A,B,C}.

Most pertinent commits:

  • 80027dd: Added the initial DotSet operation class and tests.
  • f0631b2: Added parser support for DotSet syntax in MPath strings.

Other dot operations within sets is not yet supported.

This issue has been partially implemented. Currently, set-style dot operations are implemented but only for `DotExact` operations, for example `/{A,B,C}`. Most pertinent commits: - `80027dd`: Added the initial `DotSet` operation class and tests. - `f0631b2`: Added parser support for `DotSet` syntax in MPath strings. Other dot operations within sets is not yet supported.
UserCurt modified the milestone from Release v1 to Release v2 2026-07-28 23:45:35 +00:00
Sign in to join this conversation.
No description provided.