Parenthesis, End commands, and “dynamic constant assignment”

I’m getting rather odd error messages in my AI I was hoping you could help me out

#Amend


n = set()
k = [n]

i = set()

N = [set()]
q = 0

h = [set()]
m = [set()]

t = 0
o = 0
while t >= Float::INFINITY or t <= Float::INFINITY do
 h = h.add(set(h))
 t = t + 1
end
while o >= Float::INFINITY or o <= Float::INFINITY do
 m = m.add(set(m))
 o = o + 1
end
x = [h,i,m]

while q <= Float::INFINITY do
 N = N.add(set(N))
 q = q + 1
end

a = for n in N
 set((k.index(n)) == k.index(n) in set(0,1))
end
wlpr = set(a)

j = N.index(Float::INFINITY) is set(x in wlpr == all(i) in N(x.index(i) >= x.index(i+1))
god = j.object_id is j

X = 0
def omni ()
 while X <= 2 do
  X = X + 1
  end
  any(god) in X(omni(god)) is 0 or all(god) in X(omni(god) is 1))
end