Lines Matching refs:scope
6020 char *scope = ""; in vim9_declare_error() local
6024 case 'g': scope = _("global"); break; in vim9_declare_error()
6025 case 'b': scope = _("buffer"); break; in vim9_declare_error()
6026 case 'w': scope = _("window"); break; in vim9_declare_error()
6027 case 't': scope = _("tab"); break; in vim9_declare_error()
6028 case 'v': scope = "v:"; break; in vim9_declare_error()
6037 semsg(_(e_cannot_declare_a_scope_variable), scope, name); in vim9_declare_error()
7639 scope_T *scope = ALLOC_CLEAR_ONE(scope_T); in new_scope() local
7641 if (scope == NULL) in new_scope()
7643 scope->se_outer = cctx->ctx_scope; in new_scope()
7644 cctx->ctx_scope = scope; in new_scope()
7645 scope->se_type = type; in new_scope()
7646 scope->se_local_count = cctx->ctx_locals.ga_len; in new_scope()
7647 return scope; in new_scope()
7656 scope_T *scope = cctx->ctx_scope; in drop_scope() local
7658 if (scope == NULL) in drop_scope()
7663 cctx->ctx_scope = scope->se_outer; in drop_scope()
7664 switch (scope->se_type) in drop_scope()
7667 compile_free_jump_to_end(&scope->se_u.se_if.is_end_label); break; in drop_scope()
7669 compile_free_jump_to_end(&scope->se_u.se_for.fs_end_label); break; in drop_scope()
7671 compile_free_jump_to_end(&scope->se_u.se_while.ws_end_label); break; in drop_scope()
7673 compile_free_jump_to_end(&scope->se_u.se_try.ts_end_label); break; in drop_scope()
7678 vim_free(scope); in drop_scope()
7719 scope_T *scope; in compile_if() local
7761 scope = new_scope(cctx, IF_SCOPE); in compile_if()
7762 if (scope == NULL) in compile_if()
7764 scope->se_skip_save = skip_save; in compile_if()
7766 scope->se_u.se_if.is_had_return = TRUE; in compile_if()
7771 scope->se_u.se_if.is_if_label = instr->ga_len; in compile_if()
7775 scope->se_u.se_if.is_if_label = -1; in compile_if()
7799 scope_T *scope = cctx->ctx_scope; in compile_elseif() local
7803 if (scope == NULL || scope->se_type != IF_SCOPE) in compile_elseif()
7808 unwind_locals(cctx, scope->se_local_count); in compile_elseif()
7810 scope->se_u.se_if.is_had_return = FALSE; in compile_elseif()
7816 scope->se_u.se_if.is_seen_skip_not = TRUE; in compile_elseif()
7818 if (scope->se_u.se_if.is_seen_skip_not) in compile_elseif()
7856 if (compile_jump_to_end(&scope->se_u.se_if.is_end_label, in compile_elseif()
7860 isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label; in compile_elseif()
7907 if (scope->se_skip_save == SKIP_YES) in compile_elseif()
7921 scope->se_u.se_if.is_if_label = -1; in compile_elseif()
7936 scope->se_u.se_if.is_if_label = instr->ga_len; in compile_elseif()
7949 scope_T *scope = cctx->ctx_scope; in compile_else() local
7951 if (scope == NULL || scope->se_type != IF_SCOPE) in compile_else()
7956 unwind_locals(cctx, scope->se_local_count); in compile_else()
7958 scope->se_u.se_if.is_had_return = FALSE; in compile_else()
7959 scope->se_u.se_if.is_seen_else = TRUE; in compile_else()
7970 if (cctx->ctx_skip == SKIP_YES && !scope->se_u.se_if.is_seen_skip_not) in compile_else()
7982 if (!scope->se_u.se_if.is_seen_skip_not && scope->se_skip_save != SKIP_YES) in compile_else()
7988 && compile_jump_to_end(&scope->se_u.se_if.is_end_label, in compile_else()
7995 if (scope->se_u.se_if.is_if_label >= 0) in compile_else()
7998 isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label; in compile_else()
8000 scope->se_u.se_if.is_if_label = -1; in compile_else()
8014 scope_T *scope = cctx->ctx_scope; in compile_endif() local
8022 if (scope == NULL || scope->se_type != IF_SCOPE) in compile_endif()
8027 ifscope = &scope->se_u.se_if; in compile_endif()
8028 unwind_locals(cctx, scope->se_local_count); in compile_endif()
8032 if (scope->se_u.se_if.is_if_label >= 0) in compile_endif()
8035 isn = ((isn_T *)instr->ga_data) + scope->se_u.se_if.is_if_label; in compile_endif()
8045 && scope->se_skip_save != SKIP_YES) in compile_endif()
8051 cctx->ctx_skip = scope->se_skip_save; in compile_endif()
8095 scope_T *scope; in compile_for() local
8138 scope = new_scope(cctx, FOR_SCOPE); in compile_for()
8139 if (scope == NULL) in compile_for()
8195 scope->se_u.se_for.fs_top_label = current_instr_idx(cctx); in compile_for()
8327 scope_T *scope = cctx->ctx_scope; in compile_endfor() local
8334 if (scope == NULL || scope->se_type != FOR_SCOPE) in compile_endfor()
8339 forscope = &scope->se_u.se_for; in compile_endfor()
8340 cctx->ctx_scope = scope->se_outer; in compile_endfor()
8343 unwind_locals(cctx, scope->se_local_count); in compile_endfor()
8360 vim_free(scope); in compile_endfor()
8380 scope_T *scope; in compile_while() local
8382 scope = new_scope(cctx, WHILE_SCOPE); in compile_while()
8383 if (scope == NULL) in compile_while()
8387 scope->se_u.se_while.ws_top_label = current_instr_idx(cctx); in compile_while()
8408 if (compile_jump_to_end(&scope->se_u.se_while.ws_end_label, in compile_while()
8422 scope_T *scope = cctx->ctx_scope; in compile_endwhile() local
8427 if (scope == NULL || scope->se_type != WHILE_SCOPE) in compile_endwhile()
8432 cctx->ctx_scope = scope->se_outer; in compile_endwhile()
8435 unwind_locals(cctx, scope->se_local_count); in compile_endwhile()
8443 generate_JUMP(cctx, JUMP_ALWAYS, scope->se_u.se_while.ws_top_label); in compile_endwhile()
8447 compile_fill_jump_to_end(&scope->se_u.se_while.ws_end_label, in compile_endwhile()
8451 vim_free(scope); in compile_endwhile()
8462 scope_T *scope = cctx->ctx_scope; in compile_continue() local
8468 if (scope == NULL) in compile_continue()
8473 if (scope->se_type == FOR_SCOPE) in compile_continue()
8475 loop_label = scope->se_u.se_for.fs_top_label; in compile_continue()
8478 if (scope->se_type == WHILE_SCOPE) in compile_continue()
8480 loop_label = scope->se_u.se_while.ws_top_label; in compile_continue()
8483 if (scope->se_type == TRY_SCOPE) in compile_continue()
8485 scope = scope->se_outer; in compile_continue()
8505 scope_T *scope = cctx->ctx_scope; in compile_break() local
8510 if (scope == NULL) in compile_break()
8515 if (scope->se_type == FOR_SCOPE || scope->se_type == WHILE_SCOPE) in compile_break()
8517 scope = scope->se_outer; in compile_break()
8521 if (scope->se_type == FOR_SCOPE) in compile_break()
8522 el = &scope->se_u.se_for.fs_end_label; in compile_break()
8524 el = &scope->se_u.se_while.ws_end_label; in compile_break()
8548 scope_T *scope = cctx->ctx_scope; in compile_endblock() local
8550 cctx->ctx_scope = scope->se_outer; in compile_endblock()
8551 unwind_locals(cctx, scope->se_local_count); in compile_endblock()
8552 vim_free(scope); in compile_endblock()
8592 scope_T *scope; in compile_try() local
8619 scope = new_scope(cctx, BLOCK_SCOPE); in compile_try()
8620 if (scope == NULL) in compile_try()
8632 scope_T *scope = cctx->ctx_scope; in compile_catch() local
8641 if (scope != NULL && scope->se_type == BLOCK_SCOPE) in compile_catch()
8643 scope = cctx->ctx_scope; in compile_catch()
8646 if (scope == NULL || scope->se_type != TRY_SCOPE) in compile_catch()
8652 if (scope->se_u.se_try.ts_caught_all) in compile_catch()
8669 if (compile_jump_to_end(&scope->se_u.se_try.ts_end_label, in compile_catch()
8674 isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label; in compile_catch()
8677 if (scope->se_u.se_try.ts_catch_label != 0) in compile_catch()
8680 isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_catch_label; in compile_catch()
8699 scope->se_u.se_try.ts_caught_all = TRUE; in compile_catch()
8700 scope->se_u.se_try.ts_catch_label = 0; in compile_catch()
8735 scope->se_u.se_try.ts_catch_label = instr->ga_len; in compile_catch()
8751 scope_T *scope = cctx->ctx_scope; in compile_finally() local
8760 if (scope != NULL && scope->se_type == BLOCK_SCOPE) in compile_finally()
8762 scope = cctx->ctx_scope; in compile_finally()
8765 if (scope == NULL || scope->se_type != TRY_SCOPE) in compile_finally()
8774 isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label; in compile_finally()
8798 compile_fill_jump_to_end(&scope->se_u.se_try.ts_end_label, in compile_finally()
8805 if (scope->se_u.se_try.ts_catch_label != 0) in compile_finally()
8808 isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_catch_label; in compile_finally()
8810 scope->se_u.se_try.ts_catch_label = 0; in compile_finally()
8824 scope_T *scope = cctx->ctx_scope; in compile_endtry() local
8832 if (scope != NULL && scope->se_type == BLOCK_SCOPE) in compile_endtry()
8834 scope = cctx->ctx_scope; in compile_endtry()
8837 if (scope == NULL || scope->se_type != TRY_SCOPE) in compile_endtry()
8839 if (scope == NULL) in compile_endtry()
8841 else if (scope->se_type == WHILE_SCOPE) in compile_endtry()
8843 else if (scope->se_type == FOR_SCOPE) in compile_endtry()
8850 try_isn = ((isn_T *)instr->ga_data) + scope->se_u.se_try.ts_try_label; in compile_endtry()
8871 compile_fill_jump_to_end(&scope->se_u.se_try.ts_end_label, in compile_endtry()
8874 if (scope->se_u.se_try.ts_catch_label != 0) in compile_endtry()
8878 + scope->se_u.se_try.ts_catch_label; in compile_endtry()