MCPcopy Index your code
hub / github.com/dchester/jsonpath / parseContinueStatement

Function parseContinueStatement

jsonpath.js:2911–2951  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2909 // 12.7 The continue statement
2910
2911 function parseContinueStatement() {
2912 var label = null, key;
2913
2914 expectKeyword('continue');
2915
2916 // Optimize the most common form: 'continue;'.
2917 if (source.charCodeAt(index) === 0x3B) {
2918 lex();
2919
2920 if (!state.inIteration) {
2921 throwError({}, Messages.IllegalContinue);
2922 }
2923
2924 return delegate.createContinueStatement(null);
2925 }
2926
2927 if (peekLineTerminator()) {
2928 if (!state.inIteration) {
2929 throwError({}, Messages.IllegalContinue);
2930 }
2931
2932 return delegate.createContinueStatement(null);
2933 }
2934
2935 if (lookahead.type === Token.Identifier) {
2936 label = parseVariableIdentifier();
2937
2938 key = '$' + label.name;
2939 if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
2940 throwError({}, Messages.UnknownLabel, label.name);
2941 }
2942 }
2943
2944 consumeSemicolon();
2945
2946 if (label === null && !state.inIteration) {
2947 throwError({}, Messages.IllegalContinue);
2948 }
2949
2950 return delegate.createContinueStatement(label);
2951 }
2952
2953 // 12.8 The break statement
2954

Callers 1

parseStatementFunction · 0.85

Calls 6

expectKeywordFunction · 0.85
throwErrorFunction · 0.85
peekLineTerminatorFunction · 0.85
parseVariableIdentifierFunction · 0.85
consumeSemicolonFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected