Permalink
Browse files

Holy mother of goths.

  • Loading branch information...
1 parent 6a62950 commit b8d8bc8aec070c861ba155ad8883b6e90c718579 Amos Wenger committed Jun 8, 2012
@@ -332,8 +332,18 @@ BinaryOp: class extends Expression {
}
isGeneric: func -> Bool {
- (left getType() isGeneric() && left getType() pointerLevel() == 0) ||
- (right getType() isGeneric() && right getType() pointerLevel() == 0)
+ result := (left getType() isGeneric() && left getType() pointerLevel() == 0) ||
+ (right getType() isGeneric() && right getType() pointerLevel() == 0)
+ // DEBUG
+ if (result && left getType() getName() == "Kaylos") {
+ "Wondering if generic. Left (%s) type = %s / %s (is %d), right (%s) type = %s / %s (is %d)" printfln(
+ left toString(), left getType() toString(),
+ left getType() getRef() toString(), left getType() isGeneric(),
+ right toString(), right getType() toString(),
+ right getType() getRef() toString(), right getType() isGeneric()
+ )
+ }
+ result
}
isLegal: func (res: Resolver) -> Bool {
@@ -145,7 +145,7 @@ FunctionCall: class extends Expression {
* a return expression, when it's being used.
*/
debugCondition: func -> Bool {
- name == "falafel"
+ false
}
/**
@@ -234,12 +234,6 @@ FunctionCall: class extends Expression {
resolve: func (trail: Trail, res: Resolver) -> Response {
- // DEBUG code
- if (name == "bbtrap") {
- "Trail from trap = " println()
- trail toString() println()
- }
-
if(debugCondition() || res params veryVerbose) {
"===============================================================" println()
" - Resolving call to %s (ref = %s)" printfln(name, ref ? ref toString(): "(nil)")
@@ -15,7 +15,7 @@ Tuple: class extends Expression {
clone: func -> This {
copy := new(token)
- copy type = type
+ copy type = type ? type clone() : null
elements each(|e| copy elements add(e clone()))
copy
}
@@ -93,4 +93,4 @@ Tuple: class extends Expression {
elements replace(oldie as Expression, kiddo as Expression)
}
-}
+}
@@ -56,7 +56,10 @@ Type: abstract class extends Expression {
isGeneric: func -> Bool {
if(getRef()) {
- //printf("ref of %s is %s %s\n", toString(), getRef() class name, getRef() toString())
+ // DEBUG
+ if (getName() == "Kaylos") {
+ "ref of %s is %s %s" printfln(toString(), getRef() class name, getRef() toString())
+ }
return getRef() instanceOf?(VariableDecl)
}
return false
@@ -319,7 +322,7 @@ PointerType: class extends SugarType {
dereference: func -> Type { inner }
- clone: func -> Type { new(inner, token) }
+ clone: func -> Type { new(inner clone(), token) }
}

0 comments on commit b8d8bc8

Please sign in to comment.