Made panic messages in expression-multiplex.go more informative
This commit is contained in:
parent
43130fd0da
commit
8bf3938842
@ -176,4 +176,3 @@ func (this *generator) generateBlockLoc (block *entity.Block) (llvm.Value, error
|
||||
|
||||
return this.generateStatementLoc(block.Steps[lastIndex])
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,7 @@ func (this *generator) generateExpression (expression entity.Expression) (regist
|
||||
// TODO: some of these could stand to know that they have a choice in
|
||||
// the matter.
|
||||
|
||||
switch expression := expression.(type) {
|
||||
// these give us an address
|
||||
switch expression := expression.(type) {// these give us an address
|
||||
case *entity.Dereference,
|
||||
*entity.MemberAccess,
|
||||
*entity.Slice,
|
||||
@ -45,7 +44,6 @@ func (this *generator) generateExpression (expression entity.Expression) (regist
|
||||
*entity.ValueCast,
|
||||
*entity.BitCast,
|
||||
*entity.Operation,
|
||||
*entity.Block,
|
||||
*entity.LiteralInt,
|
||||
*entity.LiteralFloat,
|
||||
*entity.LiteralBoolean,
|
||||
@ -118,7 +116,7 @@ func (this *generator) generateExpressionVal (expression entity.Expression) (llv
|
||||
return this.generateLiteralNil(expression)
|
||||
default:
|
||||
panic(fmt.Sprintf (
|
||||
"BUG: generator doesnt know about expression %v, ty: %T",
|
||||
"BUG: generator doesnt know about value expression %v, ty: %T",
|
||||
expression, expression))
|
||||
}
|
||||
}
|
||||
@ -174,7 +172,7 @@ func (this *generator) generateExpressionLoc (expression entity.Expression) (llv
|
||||
return this.generateLiteralStructLoc(expression)
|
||||
default:
|
||||
panic(fmt.Sprintf (
|
||||
"BUG: generator doesnt know about expression %v, ty: %T",
|
||||
"BUG: generator doesnt know about location expression %v, ty: %T",
|
||||
expression, expression))
|
||||
}
|
||||
}
|
||||
@ -200,7 +198,7 @@ func (this *generator) generateStatementVal (statement entity.Statement) (llvm.V
|
||||
return this.generateExpressionVal(statement)
|
||||
default:
|
||||
panic(fmt.Sprintf (
|
||||
"BUG: generator doesnt know about statement %v, ty: %T",
|
||||
"BUG: generator doesnt know about value statement %v, ty: %T",
|
||||
statement, statement))
|
||||
}
|
||||
}
|
||||
@ -211,7 +209,7 @@ func (this *generator) generateStatementLoc (statement entity.Statement) (llvm.V
|
||||
return this.generateExpressionLoc(statement)
|
||||
default:
|
||||
panic(fmt.Sprintf (
|
||||
"BUG: generator doesnt know about statement %v, ty: %T",
|
||||
"BUG: generator doesnt know about location statement %v, ty: %T",
|
||||
statement, statement))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user