Another update to Sadako. (Hopefully I’m not posting these too often.)
This one is actually a pretty big one since it affects the core functionality of the engine.
You can now write token blocks inside of token blocks. Tags inside of tags, in other words. Originally Sadako couldn’t do that. It was easy enough to get around, but now you don’t have to.
Here are some examples. For those not familiar with the syntax, I have a normal block for the first example of each and then I show one inside of another in the second examples.
Inline conditions:
{:1 == 1::this is true::this is false:}
// outputs: this is true
{:1==1::{:1==0::asdf::bleh:}::blargh:}
// outputs: bleh
Spans:
<:bleh::some text:>
// outputs: <span class="bleh">some text</span>
<:bleh::<:asdf::test:>:>
// outputs: <span class="bleh"><span class="asdf">test</span></span>
Script blocks:
[:= "bleh":]
// outputs: bleh
[:= "[:= 'test':]":]
// outputs: test
Macros:
// javascript:
sadako.macros.test = function() { return "Hi!"; };
sadako.macros.test2 = function() { return 'Test macro says, "(:= test:)"'; };
(:= test:)
// outputs: Hi!
(:= test2:)
// outputs: Test macro says, "Hi!"
You get the idea. You can also have varying kinds of blocks inside each other. It was just easier to show the example with the same kinds.