summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2020-03-19 21:14:42 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2020-03-22 02:23:52 +0000
commit4960699de2fd010598d14d59f4bcd3d9b48ec46b (patch)
tree22e266288bbf1ab09035c79989e727190a87f13f /Src/zsh.h
parentbe73026b07decc3990b2a345c42a8f7b74d8f83d (diff)
downloadzsh-4960699de2fd010598d14d59f4bcd3d9b48ec46b.tar.gz
zsh-4960699de2fd010598d14d59f4bcd3d9b48ec46b.tar.xz
zsh-4960699de2fd010598d14d59f4bcd3d9b48ec46b.zip
45583/0003: internal: Add some comments around Eccstr. No functional change.
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index 834142895..82d152bb8 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -832,13 +832,33 @@ struct estate {
     char *strs;			/* strings from prog */
 };
 
+/* 
+ * A binary tree of strings.
+ *
+ * Refer to the "Word code." comment at the top of Src/parse.c for details.
+ */
 typedef struct eccstr *Eccstr;
-
 struct eccstr {
+    /* Child pointers. */
     Eccstr left, right;
+
+    /* String; pointer into to estate::strs. */
     char *str;
-    wordcode offs, aoffs;
+
+    /* Wordcode of a long string, as described in the Src/parse.c comment. */
+    wordcode offs;
+
+    /* Raw memory offset of str in estate::strs. */
+    wordcode aoffs;
+
+    /* 
+     * ### The number of starts and ends of function definitions up to this point.
+     *
+     * String reuse may only happen between strings that have the same "nfunc" value.
+     */
     int nfunc;
+
+    /* Hash of str. */
     int hashval;
 };