mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
shader: Better error message
This commit is contained in:
parent
380b7382ac
commit
fb63df48ae
@ -18,6 +18,7 @@ import (
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/token"
|
||||
"strings"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/internal/shaderir"
|
||||
)
|
||||
@ -117,7 +118,11 @@ func (cs *compileState) parseStmt(block *block, stmt ast.Stmt, inParams []variab
|
||||
return nil, false
|
||||
}
|
||||
if len(ts) != 1 || ts[0].Main != shaderir.Bool {
|
||||
cs.addError(stmt.Pos(), fmt.Sprintf("if-condition must be bool but: %#v", ts))
|
||||
var tss []string
|
||||
for _, t := range ts {
|
||||
tss = append(tss, t.String())
|
||||
}
|
||||
cs.addError(stmt.Pos(), fmt.Sprintf("if-condition must be bool but: %s", strings.Join(tss, ", ")))
|
||||
return nil, false
|
||||
}
|
||||
stmts = append(stmts, ss...)
|
||||
|
Loading…
Reference in New Issue
Block a user