aboutsummaryrefslogtreecommitdiff
path: root/src/sc_interp.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2017-01-08 21:52:33 +0100
committerThomas White <taw@bitwiz.org.uk>2017-01-08 21:52:33 +0100
commit97266236e846fedb021a37c3a418d5b79ffed6bc (patch)
tree2bfef9545b9e43cdc62e943064572244bd1106f9 /src/sc_interp.c
parent8587b378bf7f46f248ea600ab2b789901c3348e6 (diff)
Allow bits of macros to be editable
Diffstat (limited to 'src/sc_interp.c')
-rw-r--r--src/sc_interp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c
index 86617de..92bf10f 100644
--- a/src/sc_interp.c
+++ b/src/sc_interp.c
@@ -1046,6 +1046,18 @@ static void run_macro_contents(SCInterpreter *scin)
SCBlock *contents = st->macro_contents;
sc_interp_save(scin);
+ scin->state[scin->j].macro_real_block = NULL;
+ sc_interp_add_blocks(scin, contents);
+ sc_interp_restore(scin);
+}
+
+
+static void run_editable(SCInterpreter *scin, SCBlock *contents)
+{
+ struct sc_state *st = &scin->state[scin->j];
+
+ sc_interp_save(scin);
+ scin->state[scin->j].macro_real_block = NULL;
sc_interp_add_blocks(scin, contents);
sc_interp_restore(scin);
}
@@ -1108,6 +1120,9 @@ int sc_interp_add_blocks(SCInterpreter *scin, SCBlock *bl)
} else if ( strcmp(name, "contents") == 0 ) {
run_macro_contents(scin);
+ } else if ( strcmp(name, "editable") == 0 ) {
+ run_editable(scin, child);
+
} else if ( strcmp(name, "pad") == 0 ) {
maybe_recurse_before(scin, child);
set_padding(sc_interp_get_frame(scin), options);