diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2015-11-29 18:31:56 +0800 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2015-11-30 09:17:28 +1000 |
commit | 47737deb06bb404a29bfc5192b0b44dea0d4f453 (patch) | |
tree | e2197d33a5d9a64733bc56a1630e7b84f9ab347e /jim.c | |
parent | 20fb65ac241531c216aff64cd158cd8797128d49 (diff) | |
download | jimtcl-47737deb06bb404a29bfc5192b0b44dea0d4f453.zip jimtcl-47737deb06bb404a29bfc5192b0b44dea0d4f453.tar.gz jimtcl-47737deb06bb404a29bfc5192b0b44dea0d4f453.tar.bz2 |
jim: highlight switch's case fall-through
Add comment to highlight that fall through is the
desired behaviour for cases ending without break.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'jim.c')
-rw-r--r-- | jim.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1685,6 +1685,7 @@ static int JimParseStr(struct JimParserCtx *pc) if (pc->len > 1 && pc->p[1] != '$') { break; } + /* fall through */ case ')': /* Only need a separate ')' token if the previous was a var */ if (*pc->p == '(' || pc->tt == JIM_TT_VAR) { @@ -6137,6 +6138,7 @@ static unsigned char ListElementQuotingType(const char *s, int len) case '\f': case '\v': trySimple = 0; + /* fall through */ case '{': case '}': goto testbrace; @@ -14440,8 +14442,10 @@ static int Jim_InfoCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *arg Jim_SetResultString(interp, "aio not enabled", -1); return JIM_ERR; #endif + /* fall through */ case INFO_PROCS: mode++; /* JIM_CMDLIST_PROCS */ + /* fall through */ case INFO_COMMANDS: /* mode 0 => JIM_CMDLIST_COMMANDS */ if (argc != 2 && argc != 3) { @@ -14460,8 +14464,10 @@ static int Jim_InfoCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *arg case INFO_VARS: mode++; /* JIM_VARLIST_VARS */ + /* fall through */ case INFO_LOCALS: mode++; /* JIM_VARLIST_LOCALS */ + /* fall through */ case INFO_GLOBALS: /* mode 0 => JIM_VARLIST_GLOBALS */ if (argc != 2 && argc != 3) { |