summaryrefslogtreecommitdiff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-02-12 11:51:41 -0800
committerBart Schaefer <schaefer@zsh.org>2023-02-12 11:51:41 -0800
commit3eed6f70cdfea63cfdc380a4df8382fff38af55d (patch)
treee044d367f65abaa8e63294c4c3cddbb2456397fe /Src/zsh.h
parente807ac1157015581c1466407cbe722179244be37 (diff)
downloadzsh-3eed6f70cdfea63cfdc380a4df8382fff38af55d.tar.gz
zsh-3eed6f70cdfea63cfdc380a4df8382fff38af55d.zip
51402: Some ksh/bash features, additional sanity checking
* Add "unset -n" * Allow and enforce "typeset -n -r" for read-only references * "can't change type via subscript reference" error * Better checking for self-referential declarations/assignments * Ksh-style "foo=bar; typeset -n foo" creates foo=bar reference * Support "typeset -n ref; for ref in ..." * Subscripted references use NO_EXEC for safety * References assigned in called scopes reset scope at end * Allow named references to $! $? $$ $- $0 $_
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index 1e35bd33e..96b4b06bd 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1935,6 +1935,9 @@ struct tieddata {
#define PM_NAMEDDIR (1<<29) /* has a corresponding nameddirtab entry */
#define PM_NAMEREF (1<<30) /* pointer to a different parameter */
+#define PM_SELFREF PM_UNIQUE /* Overload when namerefs resolved */
+#define PM_NEWREF PM_SINGLE /* Overload in for-loop namerefs */
+
/* The option string corresponds to the first of the variables above */
#define TYPESET_OPTSTR "aiEFALRZlurtxUhHT"
@@ -1959,6 +1962,7 @@ struct tieddata {
* elements
*/
#define SCANPM_CHECKING (1<<10) /* Check if set, no need to create */
+#define SCANPM_NOEXEC (1<<11) /* No command substitutions, etc. */
/* "$foo[@]"-style substitution
* Only sign bit is significant
*/