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

Function scanRegExp

jsonpath.js:1145–1173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1143 }
1144
1145 function scanRegExp() {
1146 var start, body, flags, pattern, value;
1147
1148 lookahead = null;
1149 skipComment();
1150 start = index;
1151
1152 body = scanRegExpBody();
1153 flags = scanRegExpFlags();
1154 value = testRegExp(body.value, flags.value);
1155
1156 if (extra.tokenize) {
1157 return {
1158 type: Token.RegularExpression,
1159 value: value,
1160 lineNumber: lineNumber,
1161 lineStart: lineStart,
1162 start: start,
1163 end: index
1164 };
1165 }
1166
1167 return {
1168 literal: body.literal + flags.literal,
1169 value: value,
1170 start: start,
1171 end: index
1172 };
1173 }
1174
1175 function collectRegex() {
1176 var pos, loc, regex, token;

Callers 2

collectRegexFunction · 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