ebiten/internal/shader/block.go

46 lines
957 B
Go
Raw Normal View History

2020-05-09 16:38:52 +02:00
// Copyright 2020 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package shader
import (
2020-05-09 19:01:28 +02:00
"go/ast"
2020-05-09 16:38:52 +02:00
"go/token"
)
type block struct {
2020-05-10 17:13:08 +02:00
types []typ
2020-05-09 17:59:18 +02:00
vars []variable
consts []constant
funcs []function
stmts []stmt
pos token.Pos
2020-05-10 12:32:40 +02:00
outer *block
2020-05-09 16:38:52 +02:00
}
2020-05-09 16:58:22 +02:00
type stmtType int
const (
stmtNone stmtType = iota
2020-05-09 19:01:28 +02:00
stmtAssign
2020-05-10 14:37:59 +02:00
stmtBlock
2020-05-09 16:58:22 +02:00
stmtReturn
)
2020-05-09 16:38:52 +02:00
type stmt struct {
2020-05-09 16:58:22 +02:00
stmtType stmtType
2020-05-09 19:01:28 +02:00
exprs []ast.Expr
2020-05-10 14:37:59 +02:00
block *block
2020-05-09 16:58:22 +02:00
}