MCPcopy
hub / github.com/mishoo/UglifyJS-old / next_token

Function next_token

lib/parse-js.js:600–615  ·  view source on GitHub ↗
(force_regexp)

Source from the content-addressed store, hash-verified

598 };
599
600 function next_token(force_regexp) {
601 if (force_regexp != null)
602 return read_regexp(force_regexp);
603 skip_whitespace();
604 start_token();
605 var ch = peek();
606 if (!ch) return token("eof");
607 if (is_digit(ch)) return read_num();
608 if (ch == '"' || ch == "'") return read_string();
609 if (HOP(PUNC_CHARS, ch)) return token("punc", next());
610 if (ch == ".") return handle_dot();
611 if (ch == "/") return handle_slash();
612 if (HOP(OPERATOR_CHARS, ch)) return read_operator();
613 if (ch == "\\" || is_identifier_start(ch)) return read_word();
614 parse_error("Unexpected character '" + ch + "'");
615 };
616
617 next_token.context = function(nc) {
618 if (nc) S = nc;

Callers 1

handle_slashFunction · 0.85

Calls 15

read_regexpFunction · 0.85
skip_whitespaceFunction · 0.85
start_tokenFunction · 0.85
peekFunction · 0.85
tokenFunction · 0.85
is_digitFunction · 0.85
read_numFunction · 0.85
read_stringFunction · 0.85
nextFunction · 0.85
handle_dotFunction · 0.85
handle_slashFunction · 0.85
read_operatorFunction · 0.85

Tested by

no test coverage detected