mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Rename PackageOrDecorator to Decorator.
This commit is contained in:
1 parent
aed3aa9925
commit
ebf3713555
6 files changed
+24
-24
No files matched your search
@@ -293,7 +293,7 @@ func (q *checker) bcheckAssignment(lhs *a.Expr, op t.ID, rhs *a.Expr) error {
|
||||
}
|
||||
|
||||
func (q *checker) bcheckAssignment1(lhs *a.Expr, op t.ID, rhs *a.Expr) error {
|
||||
switch lhs.MType().PackageOrDecorator().Key() {
|
||||
switch lhs.MType().Decorator().Key() {
|
||||
case t.KeyPtr:
|
||||
// TODO: handle.
|
||||
return nil
|
||||
@@ -805,7 +805,7 @@ func (q *checker) bcheckExprAssociativeOp(n *a.Expr, depth uint32) (*big.Int, *b
|
||||
}
|
||||
|
||||
func (q *checker) bcheckTypeExpr(n *a.TypeExpr) (*big.Int, *big.Int, error) {
|
||||
switch n.PackageOrDecorator().Key() {
|
||||
switch n.Decorator().Key() {
|
||||
case t.KeyPtr, t.KeyOpenBracket:
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
+2
-2
@@ -201,7 +201,7 @@ func (c *Checker) checkFields(fields []*a.Node, banPtrTypes bool) error {
|
||||
}
|
||||
if banPtrTypes {
|
||||
for x := f.XType(); x.Inner() != nil; x = x.Inner() {
|
||||
if x.PackageOrDecorator().Key() == t.KeyPtr {
|
||||
if x.Decorator().Key() == t.KeyPtr {
|
||||
// TODO: implement nptr (nullable pointer) types.
|
||||
return fmt.Errorf("check: ptr type %q not allowed for field %q; use nptr instead",
|
||||
x.String(c.tm), f.Name().String(c.tm))
|
||||
@@ -209,7 +209,7 @@ func (c *Checker) checkFields(fields []*a.Node, banPtrTypes bool) error {
|
||||
}
|
||||
}
|
||||
if dv := f.DefaultValue(); dv != nil {
|
||||
if f.XType().PackageOrDecorator() != 0 {
|
||||
if f.XType().Decorator() != 0 {
|
||||
return fmt.Errorf("check: cannot set default value for qualified type %q for field %q",
|
||||
f.XType().String(c.tm), f.Name().String(c.tm))
|
||||
}
|
||||
|
||||
+4
-4
@@ -358,7 +358,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
|
||||
return err
|
||||
}
|
||||
lTyp := lhs.MType()
|
||||
if lTyp.PackageOrDecorator().Key() != t.KeyOpenBracket {
|
||||
if lTyp.Decorator().Key() != t.KeyOpenBracket {
|
||||
return fmt.Errorf("%s is an array-index expression but %s has type %s, not an array type",
|
||||
n.String(q.tm), lhs.String(q.tm), lTyp.String(q.tm))
|
||||
}
|
||||
@@ -428,10 +428,10 @@ func (q *checker) tcheckDot(n *a.Expr, depth uint32) error {
|
||||
return err
|
||||
}
|
||||
lTyp := lhs.MType()
|
||||
for ; lTyp.PackageOrDecorator().Key() == t.KeyPtr; lTyp = lTyp.Inner() {
|
||||
for ; lTyp.Decorator().Key() == t.KeyPtr; lTyp = lTyp.Inner() {
|
||||
}
|
||||
|
||||
if lTyp.PackageOrDecorator() != 0 {
|
||||
if lTyp.Decorator() != 0 {
|
||||
// TODO.
|
||||
return fmt.Errorf("check: unsupported package-or-decorator for tcheckDot")
|
||||
}
|
||||
@@ -658,7 +658,7 @@ func (q *checker) tcheckTypeExpr(n *a.TypeExpr, depth uint32) error {
|
||||
}
|
||||
depth++
|
||||
|
||||
switch n.PackageOrDecorator().Key() {
|
||||
switch n.Decorator().Key() {
|
||||
case 0:
|
||||
if n.Name().IsNumType() {
|
||||
for _, b := range n.Bounds() {
|
||||
|
||||
Reference in new issue
Block a user