aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-util.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r--src/interp/g-util.boot8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 9817e8e4..c1cc9217 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -251,6 +251,12 @@ expandBcompl ['%bcompl,x] ==
integer? x => 255 - x
['_+,256,['LOGNOT,expandToVMForm x]]
+-- Character operations
+expandCcst ['%ccst,s] ==
+ not string? s => error "operand is not a string constant"
+ #s ~= 1 => error "string constant must contain exactly one character"
+ char s
+
-- Integer operations
expandIneg ['%ineg,x] ==
x := expandToVMForm x
@@ -449,6 +455,8 @@ for x in [
['%bcompl, :function expandBcompl],
+ ['%ccst, :function expandCcst],
+
['%ieq, :function expandIeq],
['%igt, :function expandIgt],
['%ilt, :function expandIlt],