diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-05-20 20:47:47 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-05-20 20:47:47 -0400 |
commit | ba0ffe00d0c62c8ac8e0f98596193b69975c9fe9 (patch) | |
tree | b1282dfefd3f3987badd6dd4b78bd278d29b8b61 | |
parent | c0cf70216341d296e1d48fc9062d9445addcc60a (diff) |
Initial boolean and/or
-rw-r--r-- | tnslc/tnslc.tnsl | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl index adc27a8..c642216 100644 --- a/tnslc/tnslc.tnsl +++ b/tnslc/tnslc.tnsl @@ -3181,7 +3181,7 @@ /; if (pr == 7) ;wk.set(s1, out) ;wk.cmp(s2, out) - ;wk.data_type = {1, "bool", "_bool", {}, {}} + ;wk.data_type = {1, "bool", {}, {}, 0} ;wk.set(literal_variable("true", "", out), out) ;{}uint8 l = scope`.next_const() @@ -3197,6 +3197,18 @@ }, "") ;return wk + ;; else if (pr == 8) + # TODO: First convert non-boolean values to boolean + /; if (tok`{first}.cmp("&&")) + ;wk.set(s1, out) + ;wk.and(s2, out) + ;; else if (tok`{first}.cmp("||")) + ;wk.set(s1, out) + ;wk.or(s2, out) + ;; else if (tok`{first}.cmp("^^")) + ;wk.set(s1, out) + ;wk.xor(s2, out) + ;/ ;/ /; if (tok`{first}.cmp("+")) @@ -3211,16 +3223,13 @@ ;wk.sub(s2, out) ;; else if (tok`{first}.cmp("|")) ;wk.set(s1, out) - ;wk.mul(s2, out) + ;wk.or(s2, out) ;; else if (tok`{first}.cmp("&")) ;wk.set(s1, out) - ;wk.mul(s2, out) + ;wk.and(s2, out) ;; else if (tok`{first}.cmp("^")) ;wk.set(s1, out) - ;wk.mul(s2, out) - ;; else if (tok`{first}.cmp("*")) - ;wk.set(s1, out) - ;wk.mul(s2, out) + ;wk.xor(s2, out) ;; else if (tok`{first}.cmp("*")) ;wk.set(s1, out) ;wk.mul(s2, out) |