Why was it decided that we make inner escapes inherit escape depth, thus requiring rework of inner escapes as add additional escapes? Why not carry the escape depth thru the argument's wrapper symbols? (Example Inside)
I am just a tinkerer, no formal education or tech related job, so my understanding comes purely from shell operations (specifically fish shell).
Is there an elegant reason we do it the way we do other than "that's how we've always done it, and now it's easier just if we just keep on keeping on"
Instead of:
"foo \"bippity \\"yo gabba \\\"example\\\" gabba\\" boppity\" baz"
why don't we have something like:
【3】foo 【2】bippity 【1】yo gabba 【 example 】 gabba 【1】 boppity 【2】 baz【3】
to further escape this you do not modify any of the contents, you just escalate your arguments final wrapping to the 4th degree with 【4】 as the delimiters.
The tradeoff being that you can no longer use arbitrary 【n】inside strings parsed by your shell as arguments, but that is why i chose some uncommon symbol (it could be anything, idk what these brackets are actually used for).
It would still support parallel nests in the same argument, you just have to ensure each "escape well" keeps its ranks non-overlapping and sequentially increasing in the outer direction. If you unescape a layer and that causes the parallel escapes to become their own highest degree, then you now have an array of arguments with any text between them that was entirely unescaped becoming command/builtin syntax (flags, subcommand, etc) that consume the args that follow them.