Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up some indentation, removed lolish names

  • Loading branch information...
commit a3171a4e09f37c1ad89d36eb2d2c8ba55e5fa64e 1 parent 5b9cbb0
@scooby authored
Showing with 23 additions and 20 deletions.
  1. +23 −20 CodeObjects.py
View
43 CodeObjects.py
@@ -31,6 +31,7 @@ def declare(self, var):
class Function(Scope):
def __init__(self, **kw):
+ pass
class Block(object):
def __init__(self, **kw):
@@ -209,9 +210,9 @@ class ComparisonExpression(Expression):
def signatures(self):
for t in self.iterInputTypes():
if not t or all(x == t[0] for x in t):
- yield { "in": t, "out": Troof }
+ yield { "in": t, "out": BoolTyp }
def iterOutputTypes(self):
- yield Troof
+ yield BoolTyp
class SetExpression(Expression):
def __init__(self, **kw):
super(SetExpression, self).__init__(**kw)
@@ -245,31 +246,31 @@ def negated(self):
class ConcatenationExpression(Expression):
def iterOutputTypes(self):
- yield Yarn
+ yield StrTyp
def signatures(self):
- for a,b in self.iterInputTypes():
- if a == Yarn and b == Yarn:
- yield { "in": (a, b), "out": Yarn }
+ for a,b in self.iterInputTypes():
+ if a == Yarn and b == Yarn:
+ yield { "in": (a, b), "out": StrTyp }
class SlicingExpression(Expression):
def __init__(self, **kw):
- super(SlicingExpression, self).__init__(**kw)
- self.bukkit = kw["bukkit"]
- for a in ("from", "back", "to", "by"):
- if a in kw:
- setattr(self, a, kw[a])
- else:
- setattr(self, a, None)
- assert issubclass(self.bukkit, Complex)
+ super(SlicingExpression, self).__init__(**kw)
+ self.bukkit = kw["bukkit"]
+ for a in ("from", "back", "to", "by"):
+ if a in kw:
+ setattr(self, a, kw[a])
+ else:
+ setattr(self, a, None)
+ assert issubclass(self.bukkit, Complex)
def iterOutputTypes(self):
- return type(self.bukkit)
+ return type(self.bukkit)
class MathExpression(Expression):
def iterOutputTypes(self):
- yield Numbar
+ yield IntTyp
def signatures(self):
- for a, b in self.iterInputTypes():
- if a == Numbar and b == Numbar:
- yield { "in": (a, b), "out": Numbar }
+ for a, b in self.iterInputTypes():
+ if a == IntTyp and b == IntTyp:
+ yield { "in": (a, b), "out": IntTyp }
# Types
class Builtin(object):
@@ -293,7 +294,9 @@ def python(self):
class Complex(Builtin):
pass
class MapTyp(Complex):
- pass
+ def __init__(self, bigness, **kw):
+ super(MapTyp, self).__init__(**kw)
+ self.bigness = bigness
def mapTypOf(key, val):
assert issubclass(key, Atomic) and issubclass(val, Atomic)
return type(name="BukkitOf%sAnd%s" % (key.__name__, val.__name__),
Please sign in to comment.
Something went wrong with that request. Please try again.