summaryrefslogtreecommitdiff
path: root/Src/Zle/compmatch.c
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-14 03:38:34 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-16 03:52:29 +0000
commit2656b8c2936a4847eac96537f7e04b2d599cd880 (patch)
tree18825b328e230aff01b0e89c2035f7a738e2c285 /Src/Zle/compmatch.c
parent00210c09db091e057e61b742a4f31204adee7894 (diff)
downloadzsh-2656b8c2936a4847eac96537f7e04b2d599cd880.tar.gz
zsh-2656b8c2936a4847eac96537f7e04b2d599cd880.zip
39310/0001: internals: match_str: Document some local variables. See 39123.
Diffstat (limited to 'Src/Zle/compmatch.c')
-rw-r--r--Src/Zle/compmatch.c58
1 files changed, 56 insertions, 2 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index 0e41ac3a5..183eb6803 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -593,9 +593,63 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
continue;
if (mp->wlen < 0) {
- int both, loff, aoff, llen, alen, zoff, moff, ct, ict, aol;
+ /*
+ * 1 iff the anchor and the word are on the same side of
+ * the line pattern; that is: if either
+ * - the anchor is on the left and we are matching
+ * a prefix; or
+ * - the anchor is on the right and we are matching
+ * a suffix.
+ */
+ int both;
+ /*
+ * Offset from the line pattern pointer ('l') to the start
+ * of the line pattern.
+ */
+ int loff;
+ /*
+ * Offset from the line pattern pointer ('l') to the start
+ * of the anchor.
+ */
+ int aoff;
+ /*
+ * The length of the line pattern.
+ */
+ int llen;
+ /*
+ * The length of the anchor.
+ *
+ * SEE: ap; aol, aop
+ */
+ int alen;
+ /*
+ * ### These two are related: they're set symmetrically.
+ */
+ int zoff, moff;
+ /*
+ * ### These two are related.
+ */
+ int ct, ict;
+ /*
+ * The length of the OTHER anchor: the left anchor when
+ * we're anchored on the right, and of the right anchor
+ * when we're anchored on the left.
+ */
+ int aol;
+ /*
+ * LOST: Documentation comment. Last seen 10 years ago in
+ * the temporal lobe. Reward promised for its safe return.
+ * Contact zsh-workers@zsh.org.
+ */
char *tp, savl = '\0', savw;
- Cpattern ap, aop;
+ /*
+ * The anchor on this end.
+ */
+ Cpattern ap;
+ /*
+ * The anchor on the other end.
+ */
+ Cpattern aop;
/* This is for `*' patterns, first initialise some
* local variables. */