Add a nullptr literal

This commit is contained in:
Nigel Tao committed 2018-07-15 16:41:23 +10:00
1 parent fdf152f8b3
commit 15f2f42b77
8 files changed
+88 -44

No files matched your search

+8
View File
@@ -701,6 +701,10 @@ func (n *TypeExpr) IsIOType() bool {
return n.id0 == 0 && n.id1 == t.IDBase && (n.id2 == t.IDIOReader || n.id2 == t.IDIOWriter)
}
func (n *TypeExpr) IsNullptr() bool {
return n.id0 == 0 && n.id1 == t.IDBase && n.id2 == t.IDQNullptr
}
func (n *TypeExpr) IsNumType() bool {
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsNumType()
}
@@ -717,6 +721,10 @@ func (n *TypeExpr) IsArrayType() bool {
return n.id0 == t.IDArray
}
func (n *TypeExpr) IsPointerType() bool {
return n.id0 == t.IDNptr || n.id0 == t.IDPtr
}
func (n *TypeExpr) IsSliceType() bool {
return n.id0 == t.IDSlice
}