MCPcopy Index your code
hub / github.com/reactjs/react-rails / lookahead2

Function lookahead2

lib/assets/javascripts/JSXTransformer.js:4067–4094  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4065 }
4066
4067 function lookahead2() {
4068 var adv, pos, line, start, result;
4069
4070 // If we are collecting the tokens, don't grab the next one yet.
4071 /* istanbul ignore next */
4072 adv = (typeof extra.advance === 'function') ? extra.advance : advance;
4073
4074 pos = index;
4075 line = lineNumber;
4076 start = lineStart;
4077
4078 // Scan for the next immediate token.
4079 /* istanbul ignore if */
4080 if (lookahead === null) {
4081 lookahead = adv();
4082 }
4083 index = lookahead.range[1];
4084 lineNumber = lookahead.lineNumber;
4085 lineStart = lookahead.lineStart;
4086
4087 // Grab the token right after.
4088 result = adv();
4089 index = pos;
4090 lineNumber = line;
4091 lineStart = start;
4092
4093 return result;
4094 }
4095
4096 function rewind(token) {
4097 index = token.range[0];

Callers 12

matchAsyncFuncExprOrDeclFunction · 0.85
parseExpressionFunction · 0.85
parsePrimaryTypeFunction · 0.85
parseExportDeclarationFunction · 0.85
parseImportDeclarationFunction · 0.85
parseClassElementFunction · 0.85
parseSourceElementFunction · 0.85
parseJSXElementNameFunction · 0.85
parseJSXAttributeNameFunction · 0.85
parseJSXElementFunction · 0.85
parseDeclareModuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected