Add an io_writer var to gif's decoder.decode_id

This commit is contained in:
Nigel Tao committed 2018-05-13 10:40:44 +10:00
1 parent 0f32650064
commit 2d3b3b1dae
7 files changed
+47 -15

No files matched your search

+6
View File
@@ -495,6 +495,8 @@ func NewField(name t.ID, xType *TypeExpr, defaultValue *Expr) *Field {
// IOBind is "io_bind (in_fields) { List2 }":
// - List0: <Expr> in.something fields
// - List2: <Statement> body
//
// TODO: in_fields and "in.something" isn't right.
type IOBind Node
func (n *IOBind) Node() *Node { return (*Node)(n) }
@@ -705,6 +707,10 @@ func (n *TypeExpr) IsIdeal() bool {
return n.id0 == 0 && n.id1 == t.IDBase && n.id2 == t.IDDoubleZ
}
func (n *TypeExpr) IsIOType() bool {
return n.id0 == 0 && n.id1 == t.IDBase && (n.id2 == t.IDIOReader || n.id2 == t.IDIOWriter)
}
func (n *TypeExpr) IsNumType() bool {
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsNumType()
}