Skip to content

Commit 911f65a

Browse files
committed
replace cmp by equ
1 parent e43dcf7 commit 911f65a

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

loda/lang/operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Type(Enum):
5656
POW = 10
5757
GCD = 11
5858
BIN = 12
59-
CMP = 13
59+
EQU = 13
6060
MIN = 14
6161
MAX = 15
6262
LPB = 16

loda/runtime/operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def bin(n, k):
119119
return mul(sign, r)
120120

121121

122-
def cmp(a, b):
123-
"""Comparison."""
122+
def equ(a, b):
123+
"""Equality."""
124124
if a == None or b == None:
125125
return None
126126
return 1 if a == b else 0
@@ -164,8 +164,8 @@ def exec_arithmetic(t: Operation.Type, a, b):
164164
return gcd(a, b)
165165
elif t == Operation.Type.BIN:
166166
return bin(a, b)
167-
elif t == Operation.Type.CMP:
168-
return cmp(a, b)
167+
elif t == Operation.Type.EQU:
168+
return equ(a, b)
169169
elif t == Operation.Type.MIN:
170170
return min(a, b)
171171
elif t == Operation.Type.MAX:

tests/programs/oeis/000/A000005.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ lpb $0
88
mov $3,$2
99
dif $3,$0
1010
sub $0,2 ; test comment
11-
cmp $3,$2
12-
cmp $3,0
11+
equ $3,$2
12+
equ $3,0
1313
add $4,$3
1414
lpe
1515
mov $0,$4

0 commit comments

Comments
 (0)