mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
compiler: refactor BinaryExpr handling
Reuse code between if conditions and expression context.
This commit is contained in:
parent
4d04c56efb
commit
51f3baf68e
2 changed files with 85 additions and 46 deletions
|
@ -31,6 +31,10 @@ func isByte(typ types.Type) bool {
|
|||
return isBasicTypeOfKind(typ, types.Uint8, types.Int8)
|
||||
}
|
||||
|
||||
func isBool(typ types.Type) bool {
|
||||
return isBasicTypeOfKind(typ, types.Bool, types.UntypedBool)
|
||||
}
|
||||
|
||||
func isNumber(typ types.Type) bool {
|
||||
t, ok := typ.Underlying().(*types.Basic)
|
||||
return ok && t.Info()&types.IsNumeric != 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue