Sequences
The command %{ ... %} allows us to turn mutiple commands into just one.
The syntax for it is a little special, due to the fact that:
- Commands which normally can only appear in the top level can now appear inside of it
- It can be nested
These are handled as follows1:
There are two seperate commands, %{ and %}, the first one, %{, stops parsing the input and then restarts the parsing as if at the top of a file.
If at any point the parser encounters a %}, it proceeds to stop parsing.
If this happens without %{, this is an error.
Otherwise, the %{ finally returns as a single command containing the entierity of the input parsed seperately.
Parsing then continues as normal after the %}, using any state changes inside %{ ... %} as appropriate.
This can be nested, with the nested calls going onto a stack.

