summaryrefslogtreecommitdiffstats
path: root/execute.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-03 20:31:40 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-03 20:31:40 +0000
commita88d53d2fda9a755c9c972a09a1206d54ca0d8b2 (patch)
tree5e9d45ab2e96fa8a96a69b00231dcc5cadd492f6 /execute.c
parent5f6a95c7b574c6d0f52e62e2405c550606a5ce75 (diff)
Extend `{foo}` syntax to allow `{"foo"}` as well.
Useful when "foo" contains unusual characters. Should help with the issues #7, #38, #40, #42.
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/execute.c b/execute.c
index 8fadc7e7..8b8036a1 100644
--- a/execute.c
+++ b/execute.c
@@ -208,6 +208,17 @@ jv jq_next() {
break;
}
+ case DUP2: {
+ stackval keep = stack_pop();
+ stackval v = stack_pop();
+ stackval v2 = v;
+ v2.value = jv_copy(v.value);
+ stack_push(v);
+ stack_push(keep);
+ stack_push(v2);
+ break;
+ }
+
case SWAP: {
stackval a = stack_pop();
stackval b = stack_pop();