comparison src/regexp.h @ 18753:6e3dc2d630c2 v8.1.2366

patch 8.1.2366: using old C style comments Commit: https://github.com/vim/vim/commit/9bf703d46a79fbffeb829246ea5ce385bddc4166 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 30 19:44:38 2019 +0100 patch 8.1.2366: using old C style comments Problem: Using old C style comments. Solution: Use // comments where appropriate.
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Nov 2019 19:45:03 +0100
parents 3d6b282e2d6e
children 89c181c99e23
comparison
equal deleted inserted replaced
18752:9ec3c9cb4533 18753:6e3dc2d630c2
31 * In the NFA engine: how many states are allowed 31 * In the NFA engine: how many states are allowed
32 */ 32 */
33 #define NFA_MAX_STATES 100000 33 #define NFA_MAX_STATES 100000
34 #define NFA_TOO_EXPENSIVE -1 34 #define NFA_TOO_EXPENSIVE -1
35 35
36 /* Which regexp engine to use? Needed for vim_regcomp(). 36 // Which regexp engine to use? Needed for vim_regcomp().
37 * Must match with 'regexpengine'. */ 37 // Must match with 'regexpengine'.
38 #define AUTOMATIC_ENGINE 0 38 #define AUTOMATIC_ENGINE 0
39 #define BACKTRACKING_ENGINE 1 39 #define BACKTRACKING_ENGINE 1
40 #define NFA_ENGINE 2 40 #define NFA_ENGINE 2
41 41
42 typedef struct regengine regengine_T; 42 typedef struct regengine regengine_T;
60 * These fields are only to be used in regexp.c! 60 * These fields are only to be used in regexp.c!
61 * See regexp.c for an explanation. 61 * See regexp.c for an explanation.
62 */ 62 */
63 typedef struct 63 typedef struct
64 { 64 {
65 /* These four members implement regprog_T */ 65 // These four members implement regprog_T
66 regengine_T *engine; 66 regengine_T *engine;
67 unsigned regflags; 67 unsigned regflags;
68 unsigned re_engine; 68 unsigned re_engine;
69 unsigned re_flags; 69 unsigned re_flags;
70 int re_in_use; 70 int re_in_use;
74 char_u *regmust; 74 char_u *regmust;
75 int regmlen; 75 int regmlen;
76 #ifdef FEAT_SYN_HL 76 #ifdef FEAT_SYN_HL
77 char_u reghasz; 77 char_u reghasz;
78 #endif 78 #endif
79 char_u program[1]; /* actually longer.. */ 79 char_u program[1]; // actually longer..
80 } bt_regprog_T; 80 } bt_regprog_T;
81 81
82 /* 82 /*
83 * Structure representing a NFA state. 83 * Structure representing a NFA state.
84 * An NFA state may have no outgoing edge, when it is a NFA_MATCH state. 84 * An NFA state may have no outgoing edge, when it is a NFA_MATCH state.
88 { 88 {
89 int c; 89 int c;
90 nfa_state_T *out; 90 nfa_state_T *out;
91 nfa_state_T *out1; 91 nfa_state_T *out1;
92 int id; 92 int id;
93 int lastlist[2]; /* 0: normal, 1: recursive */ 93 int lastlist[2]; // 0: normal, 1: recursive
94 int val; 94 int val;
95 }; 95 };
96 96
97 /* 97 /*
98 * Structure used by the NFA matcher. 98 * Structure used by the NFA matcher.
99 */ 99 */
100 typedef struct 100 typedef struct
101 { 101 {
102 /* These three members implement regprog_T */ 102 // These three members implement regprog_T
103 regengine_T *engine; 103 regengine_T *engine;
104 unsigned regflags; 104 unsigned regflags;
105 unsigned re_engine; 105 unsigned re_engine;
106 unsigned re_flags; 106 unsigned re_flags;
107 int re_in_use; 107 int re_in_use;
108 108
109 nfa_state_T *start; /* points into state[] */ 109 nfa_state_T *start; // points into state[]
110 110
111 int reganch; /* pattern starts with ^ */ 111 int reganch; // pattern starts with ^
112 int regstart; /* char at start of pattern */ 112 int regstart; // char at start of pattern
113 char_u *match_text; /* plain text to match with */ 113 char_u *match_text; // plain text to match with
114 114
115 int has_zend; /* pattern contains \ze */ 115 int has_zend; // pattern contains \ze
116 int has_backref; /* pattern contains \1 .. \9 */ 116 int has_backref; // pattern contains \1 .. \9
117 #ifdef FEAT_SYN_HL 117 #ifdef FEAT_SYN_HL
118 int reghasz; 118 int reghasz;
119 #endif 119 #endif
120 char_u *pattern; 120 char_u *pattern;
121 int nsubexp; /* number of () */ 121 int nsubexp; // number of ()
122 int nstate; 122 int nstate;
123 nfa_state_T state[1]; /* actually longer.. */ 123 nfa_state_T state[1]; // actually longer..
124 } nfa_regprog_T; 124 } nfa_regprog_T;
125 125
126 /* 126 /*
127 * Structure to be used for single-line matching. 127 * Structure to be used for single-line matching.
128 * Sub-match "no" starts at "startp[no]" and ends just before "endp[no]". 128 * Sub-match "no" starts at "startp[no]" and ends just before "endp[no]".
148 { 148 {
149 regprog_T *regprog; 149 regprog_T *regprog;
150 lpos_T startpos[NSUBEXP]; 150 lpos_T startpos[NSUBEXP];
151 lpos_T endpos[NSUBEXP]; 151 lpos_T endpos[NSUBEXP];
152 int rmm_ic; 152 int rmm_ic;
153 colnr_T rmm_maxcol; /* when not zero: maximum column */ 153 colnr_T rmm_maxcol; // when not zero: maximum column
154 } regmmatch_T; 154 } regmmatch_T;
155 155
156 /* 156 /*
157 * Structure used to store external references: "\z\(\)" to "\z\1". 157 * Structure used to store external references: "\z\(\)" to "\z\1".
158 * Use a reference count to avoid the need to copy this around. When it goes 158 * Use a reference count to avoid the need to copy this around. When it goes
171 int (*regexec_nl)(regmatch_T *, char_u *, colnr_T, int); 171 int (*regexec_nl)(regmatch_T *, char_u *, colnr_T, int);
172 long (*regexec_multi)(regmmatch_T *, win_T *, buf_T *, linenr_T, colnr_T, proftime_T *, int *); 172 long (*regexec_multi)(regmmatch_T *, win_T *, buf_T *, linenr_T, colnr_T, proftime_T *, int *);
173 char_u *expr; 173 char_u *expr;
174 }; 174 };
175 175
176 #endif /* _REGEXP_H */ 176 #endif // _REGEXP_H