summaryrefslogtreecommitdiff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2015-01-11 19:12:58 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2015-01-11 19:12:58 +0000
commit968dd7387c53aac6cc6e8d258f175e6f790d6f9d (patch)
tree4d7967c9c7a78d7e95097fe38deeb21e1bc5480f /Src/zsh.h
parent0ea940bb589e807d7412a99f2f5843b745dd356d (diff)
downloadzsh-968dd7387c53aac6cc6e8d258f175e6f790d6f9d.tar.gz
zsh-968dd7387c53aac6cc6e8d258f175e6f790d6f9d.zip
34234: use structures for normal and raw lexical buffer state
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index 8fb4f977a..94e9ffc9f 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -2717,6 +2717,27 @@ struct hist_stack {
int csp;
};
+/*
+ * State of a lexical token buffer.
+ *
+ * It would be neater to include the pointer to the start of the buffer,
+ * however the current code structure means that the standard instance
+ * of this, tokstr, is visible in lots of places, so that's not
+ * convenient.
+ */
+
+struct lexbufstate {
+ /*
+ * Next character to be added.
+ * Set to NULL when the buffer is to be visible from elsewhere.
+ */
+ char *ptr;
+ /* Allocated buffer size */
+ int siz;
+ /* Length in use */
+ int len;
+};
+
/* Lexical analyser */
struct lex_stack {
int dbparens;
@@ -2726,14 +2747,10 @@ struct lex_stack {
enum lextok tok;
char *tokstr;
char *zshlextext;
- char *bptr;
- int bsiz;
- int len;
+ struct lexbufstate lexbuf;
int lex_add_raw;
char *tokstr_raw;
- char *bptr_raw;
- int bsiz_raw;
- int len_raw;
+ struct lexbufstate lexbuf_raw;
int lexstop;
zlong toklineno;
};