Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 23116d5

Browse files
committed
Add a bit more commentary about regex's colormap tree data structure.
Per an off-list question from Piotr Stefaniak.
1 parent 91e7926 commit 23116d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/include/regex/regguts.h

+5
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ typedef int pcolor; /* what color promotes to */
162162
* deep (in the past it was shallower during construction but was "filled"
163163
* to full depth at the end of that); areas that are unaltered as yet point
164164
* to "fill blocks" which are entirely WHITE in color.
165+
*
166+
* Leaf-level tree blocks are of type "struct colors", while upper-level
167+
* blocks are of type "struct ptrs". Pointers into the tree are generally
168+
* declared as "union tree *" to be agnostic about what level they point to.
165169
*/
166170

167171
/* the tree itself */
@@ -179,6 +183,7 @@ union tree
179183
struct ptrs ptrs;
180184
};
181185

186+
/* use these pseudo-field names when dereferencing a "union tree" pointer */
182187
#define tcolor colors.ccolor
183188
#define tptr ptrs.pptr
184189

0 commit comments

Comments
 (0)