MCPcopy Index your code
hub / github.com/Macuyiko/minecraft-python / block

Function block

ServerEditorWeb/ace/worker-javascript.js:3827–3948  ·  view source on GitHub ↗
(ordinary, stmt, isfunc, isfatarrow, iscase)

Source from the content-addressed store, hash-verified

3825 }
3826 }
3827 function block(ordinary, stmt, isfunc, isfatarrow, iscase) {
3828 var a,
3829 b = inblock,
3830 old_indent = indent,
3831 m,
3832 s = scope,
3833 t,
3834 line,
3835 d;
3836
3837 inblock = ordinary;
3838
3839 if (!ordinary || !state.option.funcscope)
3840 scope = Object.create(scope);
3841
3842 t = state.tokens.next;
3843
3844 var metrics = funct["(metrics)"];
3845 metrics.nestedBlockDepth += 1;
3846 metrics.verifyMaxNestedBlockDepthPerFunction();
3847
3848 if (state.tokens.next.id === "{") {
3849 advance("{");
3850 funct["(blockscope)"].stack();
3851
3852 line = state.tokens.curr.line;
3853 if (state.tokens.next.id !== "}") {
3854 indent += state.option.indent;
3855 while (!ordinary && state.tokens.next.from > indent) {
3856 indent += state.option.indent;
3857 }
3858
3859 if (isfunc) {
3860 m = {};
3861 for (d in state.directive) {
3862 if (_.has(state.directive, d)) {
3863 m[d] = state.directive[d];
3864 }
3865 }
3866 directives();
3867
3868 if (state.option.strict && funct["(context)"]["(global)"]) {
3869 if (!m["use strict"] && !state.directive["use strict"]) {
3870 warning("E007");
3871 }
3872 }
3873 }
3874
3875 a = statements();
3876
3877 metrics.statementCount += a.length;
3878
3879 if (isfunc) {
3880 state.directive = m;
3881 }
3882
3883 indent -= state.option.indent;
3884 }

Callers 5

_throwsFunction · 0.85
statementFunction · 0.85
doFunctionFunction · 0.85
doCatchFunction · 0.85

Calls 7

advanceFunction · 0.85
directivesFunction · 0.85
warningFunction · 0.85
statementsFunction · 0.85
expressionFunction · 0.85
statementFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected