Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] internal: Document 'cmatcher', parse_cmatcher(), 'comptoend', unsetparam_pm(), and getindex().
- X-seq: zsh-workers 40067
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] internal: Document 'cmatcher', parse_cmatcher(), 'comptoend', unsetparam_pm(), and getindex().
- Date: Fri, 2 Dec 2016 16:01:04 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=TOT ZbbMbT30FutZBG/cze1GAiL8=; b=oC6JhstymJp+a1A6p+/Kkh5fhq4dZxtb0ei 1LE085yMniKOQNMd1SYQXP5HN/NNVGNqHa4bANIhWaNFIH7fxhzaD/mFQyDMmMln CZEsMxexl6teMO6Me5uBNdnCbXqg9inx6r2vBKaUcrYUaYGKvCBbL2gLWpFFJWQh NNinGUG4=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=TO TZbbMbT30FutZBG/cze1GAiL8=; b=losEwZMRobJDk+zm/BOiIoeJKFSUibBODF wTvC83sjR+CH/ria6T6Nd9AP2spCCc9OqUW8u8uAOkGfVwNYbWp6PyZsOo6bXJ+L 26efcuizR889VhamXqNvvbkKHxCBsKvKEBECUh/SumbfAlNdoTuONeljjJRcduSR CTZYa8KHQ=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
This is a documentation-only patch.
Daniel
Src/Zle/comp.h | 4 +++-
Src/Zle/complete.c | 12 ++++++++++--
Src/params.c | 18 +++++++++++++++++-
3 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/Src/Zle/comp.h b/Src/Zle/comp.h
index 3711fde..3e98345 100644
--- a/Src/Zle/comp.h
+++ b/Src/Zle/comp.h
@@ -153,7 +153,9 @@ struct cmatcher {
Cpattern line; /* what matches on the line */
int llen; /* length of line pattern */
Cpattern word; /* what matches in the word */
- int wlen; /* length of word pattern */
+ int wlen; /* length of word pattern, or:
+ -1: word pattern is one asterisk
+ -2: word pattern is two asterisks */
Cpattern left; /* left anchor */
int lalen; /* length of left anchor */
Cpattern right; /* right anchor */
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 7980518..48fcd47 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -67,7 +67,7 @@ char *compiprefix,
*compexact,
*compexactstr,
*comppatinsert,
- *comptoend,
+ *comptoend, /* compstate[to_end]; populates 'movetoend' */
*compoldlist,
*compoldins,
*compvared;
@@ -227,7 +227,15 @@ cpcpattern(Cpattern o)
return r;
}
-/* Parse a string for matcher control, containing multiple matchers. */
+/*
+ * Parse a string for matcher control, containing multiple matchers.
+ *
+ * 's' is the string to be parsed.
+ *
+ * 'name' is the name of the builtin from which this is called, for errors.
+ *
+ * Return 'pcm_err' on error; a NULL return value means ...
+ */
/**/
mod_export Cmatcher
diff --git a/Src/params.c b/Src/params.c
index aed0420..4d6266f 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1761,6 +1761,18 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w,
return r;
}
+/*
+ * Parse a subscript.
+ *
+ * pptr: In/Out parameter. On entry, *ptr points to a "[foo]" string. On exit
+ * it will point one past the closing bracket.
+ *
+ * v: In/Out parameter. Its .start and .end members (at least) will be updated
+ * with the parsed indices.
+ *
+ * flags: can be either SCANPM_DQUOTED or zero. Other bits are not used.
+ */
+
/**/
int
getindex(char **pptr, Value v, int flags)
@@ -3245,7 +3257,11 @@ unsetparam(char *s)
unqueue_signals();
}
-/* Unset a parameter */
+/* Unset a parameter
+ *
+ * altflag: if true, don't remove pm->ename from the environment
+ * exp: See stdunsetfn()
+ */
/**/
mod_export int
Messages sorted by:
Reverse Date,
Date,
Thread,
Author