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

Function scanRegExp

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

Source from the content-addressed store, hash-verified

3866 }
3867
3868 function scanRegExp() {
3869 var start, body, flags, value;
3870
3871 lookahead = null;
3872 skipComment();
3873 start = index;
3874
3875 body = scanRegExpBody();
3876 flags = scanRegExpFlags();
3877 value = testRegExp(body.value, flags.value);
3878
3879 if (extra.tokenize) {
3880 return {
3881 type: Token.RegularExpression,
3882 value: value,
3883 regex: {
3884 pattern: body.value,
3885 flags: flags.value
3886 },
3887 lineNumber: lineNumber,
3888 lineStart: lineStart,
3889 range: [start, index]
3890 };
3891 }
3892
3893 return {
3894 literal: body.literal + flags.literal,
3895 value: value,
3896 regex: {
3897 pattern: body.value,
3898 flags: flags.value
3899 },
3900 range: [start, index]
3901 };
3902 }
3903
3904 function isIdentifierName(token) {
3905 return token.type === Token.Identifier ||

Callers 2

advanceSlashFunction · 0.85
parsePrimaryExpressionFunction · 0.85

Calls 4

skipCommentFunction · 0.85
scanRegExpBodyFunction · 0.85
scanRegExpFlagsFunction · 0.85
testRegExpFunction · 0.85

Tested by

no test coverage detected