diff options
author | Jason Schulz <jason@schulz.name> | 2015-12-29 15:17:16 -0800 |
---|---|---|
committer | Jason Schulz <jason@schulz.name> | 2016-01-15 18:21:06 -0800 |
commit | 7ad3f077dc68a83b2cdfb7b1d04de9266d7978a9 (patch) | |
tree | aaa485d0853be6b46865cf2d87064ec0299f0cde /src/nvim/ascii.h | |
parent | dddbf9c5fa061cb03d6b6240ac6610b68b9304f5 (diff) | |
download | rneovim-7ad3f077dc68a83b2cdfb7b1d04de9266d7978a9.tar.gz rneovim-7ad3f077dc68a83b2cdfb7b1d04de9266d7978a9.tar.bz2 rneovim-7ad3f077dc68a83b2cdfb7b1d04de9266d7978a9.zip |
Add support for binary numbers
Diffstat (limited to 'src/nvim/ascii.h')
-rw-r--r-- | src/nvim/ascii.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/ascii.h b/src/nvim/ascii.h index 2b3e94d5a0..9938d1b328 100644 --- a/src/nvim/ascii.h +++ b/src/nvim/ascii.h @@ -122,6 +122,14 @@ static inline bool ascii_isxdigit(int c) || (c >= 'A' && c <= 'F'); } +/// Checks if `c` is a binary digit, that is, 0-1. +/// +/// @see {ascii_isdigit} +static inline bool ascii_isbdigit(int c) +{ + return (c == '0' || c == '1'); +} + /// Checks if `c` is a white-space character, that is, /// one of \f, \n, \r, \t, \v. /// |