mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Add a TypeExpr.HasPointers method.
This commit is contained in:
1 parent
7b6f7384d1
commit
95391533b3
3 files changed
+18
-25
No files matched your search
@@ -513,6 +513,22 @@ func (n *TypeExpr) IsRefined() bool {
|
||||
return t.Key(n.id0>>t.KeyShift) != t.KeyOpenBracket && (n.lhs != nil || n.mhs != nil)
|
||||
}
|
||||
|
||||
func (n *TypeExpr) HasPointers() bool {
|
||||
for ; n != nil; n = n.Inner() {
|
||||
switch n.id0.Key() {
|
||||
case 0:
|
||||
// TODO: add t.KeyReader1, after figuring out how limit's should really work.
|
||||
switch n.id1.Key() {
|
||||
case t.KeyBuf1, t.KeyBuf1Mark, t.KeyWriter1, t.KeyBuf2:
|
||||
return true
|
||||
}
|
||||
case t.KeyPtr, t.KeyNptr, t.KeyColon:
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (n *TypeExpr) Unrefined() *TypeExpr {
|
||||
if !n.IsRefined() {
|
||||
return n
|
||||
|
||||
Reference in new issue
Block a user