MCPcopy Create free account
hub / github.com/node-inspector/node-inspector / read_regexp

Function read_regexp

front-end/UglifyJS/parse-js.js:440–464  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

438 };
439
440 function read_regexp() {
441 return with_eof_error("Unterminated regular expression", function(){
442 var prev_backslash = false, regexp = "", ch, in_class = false;
443 while ((ch = next(true))) if (prev_backslash) {
444 regexp += "\\" + ch;
445 prev_backslash = false;
446 } else if (ch == "[") {
447 in_class = true;
448 regexp += ch;
449 } else if (ch == "]" && in_class) {
450 in_class = false;
451 regexp += ch;
452 } else if (ch == "/" && !in_class) {
453 break;
454 } else if (ch == "\\") {
455 prev_backslash = true;
456 } else {
457 regexp += ch;
458 }
459 var mods = read_while(function(ch){
460 return HOP(REGEXP_MODIFIERS, ch);
461 });
462 return token("regexp", [ regexp, mods ]);
463 });
464 };
465
466 function read_operator(prefix) {
467 function grow(op) {

Callers 2

handle_slashFunction · 0.85
next_tokenFunction · 0.85

Calls 5

with_eof_errorFunction · 0.85
nextFunction · 0.85
read_whileFunction · 0.85
HOPFunction · 0.85
tokenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…