mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Remove the implicit out variable
This commit is contained in:
1 parent
9919d78245
commit
58ded30954
4 files changed
+3
-14
No files matched your search
@@ -196,9 +196,9 @@ loop:
|
|||||||
}
|
}
|
||||||
// o is a yield statement.
|
// o is a yield statement.
|
||||||
//
|
//
|
||||||
// Drop any facts involving in, out or this.
|
// Drop any facts involving in or this.
|
||||||
if err := q.facts.update(func(x *a.Expr) (*a.Expr, error) {
|
if err := q.facts.update(func(x *a.Expr) (*a.Expr, error) {
|
||||||
if x.Mentions(exprIn) || x.Mentions(exprOut) || x.Mentions(exprThis) {
|
if x.Mentions(exprIn) || x.Mentions(exprThis) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
return x, nil
|
return x, nil
|
||||||
|
|||||||
@@ -547,16 +547,8 @@ func (c *Checker) checkFuncSignature(node *a.Node) error {
|
|||||||
inTyp.AsNode().SetMBounds(a.Bounds{zero, zero})
|
inTyp.AsNode().SetMBounds(a.Bounds{zero, zero})
|
||||||
inTyp.AsNode().SetMType(typeExprTypeExpr)
|
inTyp.AsNode().SetMType(typeExprTypeExpr)
|
||||||
|
|
||||||
outTyp := n.Out()
|
|
||||||
if outTyp == nil {
|
|
||||||
outTyp = typeExprEmptyStruct
|
|
||||||
}
|
|
||||||
|
|
||||||
localVars := typeMap{
|
localVars := typeMap{
|
||||||
t.IDIn: inTyp,
|
t.IDIn: inTyp,
|
||||||
// TODO: drop the implicit "out" variable (and exprOut in this
|
|
||||||
// package)?
|
|
||||||
t.IDOut: outTyp,
|
|
||||||
}
|
}
|
||||||
if qqid[1] != 0 {
|
if qqid[1] != 0 {
|
||||||
if _, ok := c.structs[t.QID{qqid[0], qqid[1]}]; !ok {
|
if _, ok := c.structs[t.QID{qqid[0], qqid[1]}]; !ok {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
exprIn = a.NewExpr(0, 0, 0, t.IDIn, nil, nil, nil, nil)
|
exprIn = a.NewExpr(0, 0, 0, t.IDIn, nil, nil, nil, nil)
|
||||||
exprOut = a.NewExpr(0, 0, 0, t.IDOut, nil, nil, nil, nil)
|
|
||||||
exprThis = a.NewExpr(0, 0, 0, t.IDThis, nil, nil, nil, nil)
|
exprThis = a.NewExpr(0, 0, 0, t.IDThis, nil, nil, nil, nil)
|
||||||
exprNullptr = a.NewExpr(0, 0, 0, t.IDNullptr, nil, nil, nil, nil)
|
exprNullptr = a.NewExpr(0, 0, 0, t.IDNullptr, nil, nil, nil, nil)
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-3
@@ -445,8 +445,7 @@ const (
|
|||||||
|
|
||||||
IDThis = ID(0x130)
|
IDThis = ID(0x130)
|
||||||
IDIn = ID(0x131)
|
IDIn = ID(0x131)
|
||||||
IDOut = ID(0x132)
|
IDBase = ID(0x132)
|
||||||
IDBase = ID(0x133)
|
|
||||||
|
|
||||||
// TODO Read/Write 24 bits? It might be useful for RGB triples.
|
// TODO Read/Write 24 bits? It might be useful for RGB triples.
|
||||||
|
|
||||||
@@ -735,7 +734,6 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
|
|
||||||
IDThis: "this",
|
IDThis: "this",
|
||||||
IDIn: "in",
|
IDIn: "in",
|
||||||
IDOut: "out",
|
|
||||||
IDBase: "base",
|
IDBase: "base",
|
||||||
|
|
||||||
IDUndoByte: "undo_byte",
|
IDUndoByte: "undo_byte",
|
||||||
|
|||||||
Reference in new issue
Block a user