mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
bit shifting operators [ and ] for {.calc.}
This commit is contained in:
parent
6b2a852ca5
commit
3b01699f86
@ -2525,7 +2525,7 @@ begin
|
||||
ch:=s[i];
|
||||
v:=0;
|
||||
case ch of
|
||||
'*','/','%': v:=5+ofsImp;
|
||||
'*','/','%','[',']': v:=5+ofsImp;
|
||||
'+','-': v:=3+ofsImp;
|
||||
'(': inc(ofsImp, PAR_VAL);
|
||||
')': dec(ofsImp, PAR_VAL);
|
||||
@ -2562,6 +2562,8 @@ begin
|
||||
'%':
|
||||
if right <> 0 then result:=trunc(left) mod trunc(right)
|
||||
else raise Exception.create('division by zero');
|
||||
'[': result:=round(left) shl round(right);
|
||||
']': result:=round(left) shr round(right);
|
||||
else raise Exception.create('operator not supported: '+ch);
|
||||
end;
|
||||
// replace sub-expression with result
|
||||
|
||||
Loading…
Reference in New Issue
Block a user