diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-12-09 18:47:34 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-12-09 18:47:34 +0100 |
commit | 3cc7ebf8107bddb42a566ede4c2a51818ff623c5 (patch) | |
tree | e2f7a79ff73ee7a8e2a292f77fdb0df67485e555 /src/nvim/ascii.h | |
parent | afae4b514183c490737a28f2946def717e78a11c (diff) | |
parent | fbdc3ac4efbc97e2965b6083d429beabe261461c (diff) | |
download | rneovim-3cc7ebf8107bddb42a566ede4c2a51818ff623c5.tar.gz rneovim-3cc7ebf8107bddb42a566ede4c2a51818ff623c5.tar.bz2 rneovim-3cc7ebf8107bddb42a566ede4c2a51818ff623c5.zip |
Merge #7234 'built-in expression parser'
Diffstat (limited to 'src/nvim/ascii.h')
-rw-r--r-- | src/nvim/ascii.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/ascii.h b/src/nvim/ascii.h index adde91f9ec..9ccb70764d 100644 --- a/src/nvim/ascii.h +++ b/src/nvim/ascii.h @@ -3,6 +3,7 @@ #include <stdbool.h> +#include "nvim/macros.h" #include "nvim/func_attr.h" #include "nvim/os/os_defs.h" @@ -98,6 +99,10 @@ static inline bool ascii_isxdigit(int) REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; +static inline bool ascii_isident(int) + REAL_FATTR_CONST + REAL_FATTR_ALWAYS_INLINE; + static inline bool ascii_isbdigit(int) REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; @@ -138,6 +143,14 @@ static inline bool ascii_isxdigit(int c) || (c >= 'A' && c <= 'F'); } +/// Checks if `c` is an “identifier” character +/// +/// That is, whether it is alphanumeric character or underscore. +static inline bool ascii_isident(const int c) +{ + return ASCII_ISALNUM(c) || c == '_'; +} + /// Checks if `c` is a binary digit, that is, 0-1. /// /// @see {ascii_isdigit} |