aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_eval.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_eval.h')
-rw-r--r--src/nvim/ex_eval.h49
1 files changed, 25 insertions, 24 deletions
diff --git a/src/nvim/ex_eval.h b/src/nvim/ex_eval.h
index 30871c7711..d5f8737bf3 100644
--- a/src/nvim/ex_eval.h
+++ b/src/nvim/ex_eval.h
@@ -23,19 +23,19 @@ struct eslist_elem {
#define CSTACK_LEN 50
struct condstack {
- short cs_flags[CSTACK_LEN]; /* CSF_ flags */
- char cs_pending[CSTACK_LEN]; /* CSTP_: what's pending in ":finally"*/
+ int cs_flags[CSTACK_LEN]; // CSF_ flags
+ char cs_pending[CSTACK_LEN]; // CSTP_: what's pending in ":finally"
union {
- void *csp_rv[CSTACK_LEN]; /* return typeval for pending return */
- void *csp_ex[CSTACK_LEN]; /* exception for pending throw */
+ void *csp_rv[CSTACK_LEN]; // return typeval for pending return
+ void *csp_ex[CSTACK_LEN]; // exception for pending throw
} cs_pend;
- void *cs_forinfo[CSTACK_LEN]; /* info used by ":for" */
- int cs_line[CSTACK_LEN]; /* line nr of ":while"/":for" line */
- int cs_idx; /* current entry, or -1 if none */
- int cs_looplevel; /* nr of nested ":while"s and ":for"s */
- int cs_trylevel; /* nr of nested ":try"s */
- eslist_T *cs_emsg_silent_list; /* saved values of "emsg_silent" */
- char cs_lflags; /* loop flags: CSL_ flags */
+ void *cs_forinfo[CSTACK_LEN]; // info used by ":for"
+ int cs_line[CSTACK_LEN]; // line nr of ":while"/":for" line
+ int cs_idx; // current entry, or -1 if none
+ int cs_looplevel; // nr of nested ":while"s and ":for"s
+ int cs_trylevel; // nr of nested ":try"s
+ eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent"
+ int cs_lflags; // loop flags: CSL_ flags
};
# define cs_rettv cs_pend.csp_rv
# define cs_exception cs_pend.csp_ex
@@ -89,28 +89,29 @@ struct msglist {
struct msglist *next; /* next of several messages in a row */
};
+// The exception types.
+typedef enum
+{
+ ET_USER, // exception caused by ":throw" command
+ ET_ERROR, // error exception
+ ET_INTERRUPT // interrupt exception triggered by Ctrl-C
+} except_type_T;
+
/*
* Structure describing an exception.
* (don't use "struct exception", it's used by the math library).
*/
typedef struct vim_exception except_T;
struct vim_exception {
- int type; /* exception type */
- char_u *value; /* exception value */
- struct msglist *messages; /* message(s) causing error exception */
- char_u *throw_name; /* name of the throw point */
- linenr_T throw_lnum; /* line number of the throw point */
- except_T *caught; /* next exception on the caught stack */
+ except_type_T type; // exception type
+ char_u *value; // exception value
+ struct msglist *messages; // message(s) causing error exception
+ char_u *throw_name; // name of the throw point
+ linenr_T throw_lnum; // line number of the throw point
+ except_T *caught; // next exception on the caught stack
};
/*
- * The exception types.
- */
-#define ET_USER 0 /* exception caused by ":throw" command */
-#define ET_ERROR 1 /* error exception */
-#define ET_INTERRUPT 2 /* interrupt exception triggered by Ctrl-C */
-
-/*
* Structure to save the error/interrupt/exception state between calls to
* enter_cleanup() and leave_cleanup(). Must be allocated as an automatic
* variable by the (common) caller of these functions.