aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/g-opt.boot20
-rw-r--r--src/interp/g-util.boot8
2 files changed, 18 insertions, 10 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 2a2f5a60..c7121f01 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -439,17 +439,17 @@ $VMsideEffectFreeOperators ==
SPADfirst QVELT _+ _- _* _< _= _<_= _> _>_= ASH INTEGER_-LENGTH
QEQCAR QCDR QCAR IDENTP SYMBOLP
GREATERP ZEROP ODDP FLOAT_-RADIX FLOAT FLOAT_-SIGN
- CGREATERP GGREATERP CHAR GET BVEC_-GREATER %false %true
+ CGREATERP GGREATERP CHAR GET BVEC_-GREATER %when %false %true
%and %or %not %peq %ieq %ilt %ile %igt %ige %head %tail %integer?
- %beq %blt %ble %bgt %bge %bitand %bitior %bitnot %bcompl
- %icst0 %icst1
- %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd? %iinc
- %feq %flt %fle %fgt %fge %fmul %fadd %fsub %fexp %fmin %fmax %float?
- %fpow %fdiv %fneg %i2f %fminval %fmaxval %fbase %fprec %ftrunc
- %nil %pair? %lconcat %llength %lfirst %lsecond %lthird
- %lreverse %lempty? %hash %ismall? %string? %f2s
- %ceq %clt %cle %cgt %cge %c2i %i2c %sname
- %vref %vlength %before?)
+ %beq %blt %ble %bgt %bge %bitand %bitior %bitnot %bcompl
+ %icst0 %icst1
+ %imul %iadd %isub %igcd %ilcm %ipow %imin %imax %ieven? %iodd? %iinc
+ %feq %flt %fle %fgt %fge %fmul %fadd %fsub %fexp %fmin %fmax %float?
+ %fpow %fdiv %fneg %i2f %fminval %fmaxval %fbase %fprec %ftrunc
+ %nil %pair? %lconcat %llength %lfirst %lsecond %lthird
+ %lreverse %lempty? %hash %ismall? %string? %f2s
+ %ccst %ceq %clt %cle %cgt %cge %c2i %i2c %sname
+ %vref %vlength %before?)
++ List of simple VM operators
$simpleVMoperators ==
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],