aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/exec.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-10-21 13:28:25 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-10-21 13:28:25 -0700
commitda77d3be2eb0785bc0c0b60c686e163d6243c744 (patch)
tree75f15d89c1517bf0ba82128753fd0f6c4d3d2447 /sys/cmd/rc/exec.c
parent65193a54609c558e473118dba323edc001bdb585 (diff)
feat(rc): added andand and oror operators
Diffstat (limited to 'sys/cmd/rc/exec.c')
-rw-r--r--sys/cmd/rc/exec.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/cmd/rc/exec.c b/sys/cmd/rc/exec.c
index 425d00f..68d366a 100644
--- a/sys/cmd/rc/exec.c
+++ b/sys/cmd/rc/exec.c
@@ -578,6 +578,24 @@ Xword(void)
pushword(runner->code.exe[runner->code.i++].s);
}
+void
+Xtrue(void)
+{
+ if(!runner->status)
+ runner->code.i++;
+ else
+ runner->code.i = runner->code.exe[runner->code.i].i;
+}
+
+void
+Xfalse(void)
+{
+ if(runner->status)
+ runner->code.i++;
+ else
+ runner->code.i = runner->code.exe[runner->code.i].i;
+}
+
static
Word*
catlist(Word *l, Word *r, Word *tail)