Files
littlefs/scripts
Christopher Haster d23edafcfe scripts: Implemented recursive punescape nesting
The previous implementation of punescape nesting only supported one
layer, because I didn't want to rewrite the pure re.sub approach.

But regex is not a pushdown automaton!

I.e. it's impossible to match both of these correctly:

  %{a%}s%{b%}s
  %{a%{a%}s%}s

This rewrites punescape and psplit to properly parse the punescape
string, recursing when we encounter "%{" and terminating on "%}s".

As a plus this shows that the punescape grammar is sound. This was a bit
up in the air with the hacky regex globbing.
2026-03-09 22:57:20 -05:00
..
2025-04-16 15:23:06 -05:00