Post #2280774
2025-10-30 13:09 UTC
Replies (1)
-
@sminez@hachyderm.io 2025-10-30 13:43
@jbert@hachyderm.io OK, found an example of what I'm talking about. This is VERY contrived and the output below is showing some debugging prints that fire when match actions are being collected followed by the final output when things are run in order. The input text is this: A bar baz B C baz bar D And this is the script: , x/ba\w/ { g/r/ /[A-Z]/ p/>$0\n/; } Output: ADD ACTION: Action { kind: Print, template: 0 } -> "B" ADD ACTION: Action { kind: Print, template: 1 } -> "A" ADD ACTION: Action { kind: Print, template: 1 } -> "C" ADD ACTION: Action { kind: Print, template: 0 } -> "D" >B >D< The original matches being found by "x/ba\w/" are sequential within the file, but the group branches are searching forward or backward from that initial position based on what was matched. It is (of course) fully valid to say that this sort of thing shouldn't be supported 😅