diff options
Diffstat (limited to 'src/nvim/regexp_defs.h')
-rw-r--r-- | src/nvim/regexp_defs.h | 70 |
1 files changed, 27 insertions, 43 deletions
diff --git a/src/nvim/regexp_defs.h b/src/nvim/regexp_defs.h index b24ed350e8..ee32b8d13a 100644 --- a/src/nvim/regexp_defs.h +++ b/src/nvim/regexp_defs.h @@ -1,13 +1,11 @@ -/* - * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE - * - * This is NOT the original regular expression code as written by Henry - * Spencer. This code has been modified specifically for use with Vim, and - * should not be used apart from compiling Vim. If you want a good regular - * expression library, get the original code. - * - * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE - */ +// NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE +// +// This is NOT the original regular expression code as written by Henry +// Spencer. This code has been modified specifically for use with Vim, and +// should not be used apart from compiling Vim. If you want a good regular +// expression library, get the original code. +// +// NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE #ifndef NVIM_REGEXP_DEFS_H #define NVIM_REGEXP_DEFS_H @@ -17,18 +15,14 @@ #include "nvim/pos.h" #include "nvim/types.h" -/* - * The number of sub-matches is limited to 10. - * The first one (index 0) is the whole match, referenced with "\0". - * The second one (index 1) is the first sub-match, referenced with "\1". - * This goes up to the tenth (index 9), referenced with "\9". - */ +// The number of sub-matches is limited to 10. +// The first one (index 0) is the whole match, referenced with "\0". +// The second one (index 1) is the first sub-match, referenced with "\1". +// This goes up to the tenth (index 9), referenced with "\9". #define NSUBEXP 10 -/* - * In the NFA engine: how many braces are allowed. - * TODO(RE): Use dynamic memory allocation instead of static, like here - */ +// In the NFA engine: how many braces are allowed. +// TODO(RE): Use dynamic memory allocation instead of static, like here #define NFA_MAX_BRACES 20 // In the NFA engine: how many states are allowed. @@ -61,11 +55,9 @@ typedef struct { #include "nvim/buffer_defs.h" -/* - * Structure returned by vim_regcomp() to pass on to vim_regexec(). - * This is the general structure. For the actual matcher, two specific - * structures are used. See code below. - */ +// Structure returned by vim_regcomp() to pass on to vim_regexec(). +// This is the general structure. For the actual matcher, two specific +// structures are used. See code below. struct regprog { regengine_T *engine; unsigned regflags; @@ -74,11 +66,9 @@ struct regprog { bool re_in_use; ///< prog is being executed }; -/* - * Structure used by the back track matcher. - * These fields are only to be used in regexp.c! - * See regexp.c for an explanation. - */ +// Structure used by the back track matcher. +// These fields are only to be used in regexp.c! +// See regexp.c for an explanation. typedef struct { // These four members implement regprog_T. regengine_T *engine; @@ -107,9 +97,7 @@ struct nfa_state { int val; }; -/* - * Structure used by the NFA matcher. - */ +// Structure used by the NFA matcher. typedef struct { // These four members implement regprog_T. regengine_T *engine; @@ -133,11 +121,9 @@ typedef struct { nfa_state_T state[1]; // actually longer.. } nfa_regprog_T; -/* - * Structure to be used for single-line matching. - * Sub-match "no" starts at "startp[no]" and ends just before "endp[no]". - * When there is no match, the pointer is NULL. - */ +// Structure to be used for single-line matching. +// Sub-match "no" starts at "startp[no]" and ends just before "endp[no]". +// When there is no match, the pointer is NULL. typedef struct { regprog_T *regprog; char *startp[NSUBEXP]; @@ -145,11 +131,9 @@ typedef struct { bool rm_ic; } regmatch_T; -/* - * Structure used to store external references: "\z\(\)" to "\z\1". - * Use a reference count to avoid the need to copy this around. When it goes - * from 1 to zero the matches need to be freed. - */ +// Structure used to store external references: "\z\(\)" to "\z\1". +// Use a reference count to avoid the need to copy this around. When it goes +// from 1 to zero the matches need to be freed. struct reg_extmatch { int16_t refcnt; char_u *matches[NSUBEXP]; |