diff options
| author | gingerBill <bill@gingerbill.org> | 2018-02-17 18:34:14 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-02-17 18:34:14 +0000 |
| commit | 21432ba96efc2622f12b2939a0e5d9c2baa0d2c2 (patch) | |
| tree | e960d1eaf535e4b5a4d89be1dfecd11ed1966aa6 /src/types.cpp | |
| parent | c341597657d92834209b720efc54011bf0179828 (diff) | |
Clean up range code for switch
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index 09b91ee34..1f9724578 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -666,6 +666,13 @@ bool is_type_rune(Type *t) { } return false; } +bool is_type_number(Type *t) { + t = core_type(t); + if (t->kind == Type_Basic) { + return (t->Basic.flags & BasicFlag_Numeric) != 0; + } + return false; +} bool is_type_numeric(Type *t) { t = core_type(t); if (t->kind == Type_Basic) { |