aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Beppu <beppu@lbox.org>2000-06-21 18:00:46 +0000
committerJohn Beppu <beppu@lbox.org>2000-06-21 18:00:46 +0000
commitc03525475e0e72b8579a5fbec5571467a99c725a (patch)
tree8687adb45e009fe47f40f32d964d56234ce35d44
parente63ad9ba06d1462f6f55941c4a08ee68618c6cd3 (diff)
downloadbusybox-w32-c03525475e0e72b8579a5fbec5571467a99c725a.tar.gz
busybox-w32-c03525475e0e72b8579a5fbec5571467a99c725a.tar.bz2
busybox-w32-c03525475e0e72b8579a5fbec5571467a99c725a.zip
+ made it so that you can use the mnemonics
(add, sub, mul, div) in lieu of (+, -, *, /)
-rw-r--r--math.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/math.c b/math.c
index eb8f331fd..15a826ce4 100644
--- a/math.c
+++ b/math.c
@@ -92,15 +92,19 @@ struct op {
92}; 92};
93 93
94static const struct op operators[] = { 94static const struct op operators[] = {
95 {"+", add}, 95 {"+", add},
96 {"-", sub}, 96 {"add", add},
97 {"*", mul}, 97 {"-", sub},
98 {"/", divide}, 98 {"sub", sub},
99 {"*", mul},
100 {"mul", mul},
101 {"/", divide},
102 {"div", divide},
99 {"and", and}, 103 {"and", and},
100 {"or", or}, 104 {"or", or},
101 {"not", not}, 105 {"not", not},
102 {"eor", eor}, 106 {"eor", eor},
103 {0, 0} 107 {0, 0}
104}; 108};
105 109
106static void stack_machine(const char *argument) 110static void stack_machine(const char *argument)