mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
lang/ast: add TypeExpr.IsXxx methods
This commit is contained in:
1 parent
2f5108978d
commit
6f79c182ea
2 files changed
+18
No files matched your search
@@ -917,6 +917,10 @@ func (n *TypeExpr) IsCPUArchType() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsBuiltInCPUArch()
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsEmptyStruct() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase && n.id2 == t.IDEmptyStruct
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsEtcUtilityType() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsEtcUtility()
|
||||
}
|
||||
@@ -953,6 +957,14 @@ func (n *TypeExpr) IsNumTypeOrIdeal() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsNumTypeOrIdeal()
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsRangeType() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsRangeType()
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsRectType() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsRectType()
|
||||
}
|
||||
|
||||
func (n *TypeExpr) IsRefined() bool {
|
||||
return n.id0 == 0 && n.id1 == t.IDBase && n.id2.IsNumType() && (n.lhs != nil || n.mhs != nil)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user