added `shl` and `shr` + code cleanup (indentation fix)
drkameleon yaniszaf@gmail.com
Thu, 21 Jan 2021 13:59:29 +0100
1 files changed,
20 insertions(+),
6 deletions(-)
jump to
M
minpkg/lib/min_binary.nim
→
minpkg/lib/min_binary.nim
@@ -28,11 +28,25 @@ let a = vals[1]
i.push newVal(a.intVal or b.intVal) - def.symbol("bitxor") do (i: In): - let vals = i.expect("int","int") - let b = vals[0] - let a = vals[1] - - i.push newVal(a.intVal xor b.intVal) + def.symbol("bitxor") do (i: In): + let vals = i.expect("int","int") + let b = vals[0] + let a = vals[1] + + i.push newVal(a.intVal xor b.intVal) + + def.symbol("shl") do (i: In): + let vals = i.expect("int","int") + let b = vals[0] + let a = vals[1] + + i.push newVal(a.intVal shl b.intVal) + + def.symbol("shr") do (i: In): + let vals = i.expect("int","int") + let b = vals[0] + let a = vals[1] + + i.push newVal(a.intVal shr b.intVal) def.finalize("binary")