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
Structural grepping could benefit from optional normalization so that this pattern:
match $_ { Ok($p0) => $p0, Err($p1) => $p1 } }
Would match both of these:
match x { Ok(a) => a, Err(b) => b } }
match x { Err(a) => a, Ok(b) => b } }
The normalization pass in this case would be: when tracing a node that can have a collection of descendants whose order may not be significant, trace all the children, and then sort the traces (arbitrarily, but consistent for the same content). All optional normalizations are lossy; in this case, no attempt will be made to determine whether e.g. a previous guarded match affects a later match so that rearrangement is semantically effectful.
There are other normalizations that would be useful. The API should support enabling individual normalizations, and also define a standard set to enable for "loose matching mode".
The text was updated successfully, but these errors were encountered:
The loose matching flag would be the interface for structural grep. For lints, etc. explicitness and fine-grained loosening would be preferable. An attribute in the patterns seems like the right interface there:
Structural grepping could benefit from optional normalization so that this pattern:
Would match both of these:
The normalization pass in this case would be: when tracing a node that can have a collection of descendants whose order may not be significant, trace all the children, and then sort the traces (arbitrarily, but consistent for the same content). All optional normalizations are lossy; in this case, no attempt will be made to determine whether e.g. a previous guarded match affects a later match so that rearrangement is semantically effectful.
There are other normalizations that would be useful. The API should support enabling individual normalizations, and also define a standard set to enable for "loose matching mode".
The text was updated successfully, but these errors were encountered: