mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 08:47:56 +01:00
ast: add TypeExpr.IsSmallInteger method
This commit is contained in:
1 parent
c4d2fa13da
commit
0164364106
3 files changed
+8
-13
No files matched your search
@@ -1007,6 +1007,11 @@ func (n *TypeExpr) IsContainerOfSpecificNumType(container t.ID, numType t.ID) bo
|
||||
return (n.id0 == container) && n.Inner().IsNumType() && (n.Inner().id2 == numType)
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsSmallInteger() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase &&
|
||||
(n.id2 == t.IDU8 || n.id2 == t.IDU16)
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsUnsignedInteger() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase &&
|
||||
(n.id2 == t.IDU8 || n.id2 == t.IDU16 || n.id2 == t.IDU32 || n.id2 == t.IDU64)
|
||||
|
||||
Reference in new issue
Block a user