I notice that Bard / CHATGPT and quantum computing are allowed topics in this board.
So, here I think my topic would be Okey, let me know please.
What I want is this
Assume I have a text.
{command block start}
some command, several lines of command
{command block end}
{command block 2 start}
some command, several lines of command
{command block 2 end}
...
{command block N start}
some command, several lines of command
{command block N end}
some text more text lorem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. [b]inline command; another inline command ; ... final inline command; [can be captured by a regex] [/b] Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
{command block N +1 start}
some command, several lines of command
{command block N +1 end}
some more text
{NESTED command block 1 start}
some command, several lines of command
{NESTED command block 1 end}
...
{NESTED command block N start}
some command, several lines of command
{NESTED command block N end}
{command block N +2 start}
some command, several lines of command
{command block N +2 end}
more text
I want to build a parser, with live preview ability. I know the regexes i need to capture the commands, separate the text etc.
But what are some ways to do live updates? Parsing everything at once every time X number of keys are pressed? I know the latex editor Gummi runs the latex compiler every time the input text is changed.
But that seems wasteful. Other there other known, standardized algorithms that are relevant to a task like this ?
Thank you.
PS.
I should add, that it is safe to assume, that not counting nesting (or at a constant nesting level) command block i is fully independent of command block j, if i =/= j