MCPcopy Create free account
hub / github.com/microsoft/SandDance / scanRegExpFlags

Function scanRegExpFlags

docs/app/js/sanddance-app.js:143933–143952  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143931 };
143932}
143933function scanRegExpFlags() {
143934 var ch, str, flags;
143935 str = "";
143936 flags = "";
143937 while(index < length){
143938 ch = source[index];
143939 if (!isIdentifierPart(ch.charCodeAt(0))) break;
143940 ++index;
143941 if (ch === "\\" && index < length) throwError({}, MessageUnexpectedToken, ILLEGAL);
143942 else {
143943 flags += ch;
143944 str += ch;
143945 }
143946 }
143947 if (flags.search(/[^gimuy]/g) >= 0) throwError({}, MessageInvalidRegExp, flags);
143948 return {
143949 value: flags,
143950 literal: str
143951 };
143952}
143953function scanRegExp() {
143954 var start, body, flags, value;
143955 lookahead = null;

Callers 1

scanRegExpFunction · 0.70

Calls 2

isIdentifierPartFunction · 0.70
throwErrorFunction · 0.70

Tested by

no test coverage detected