Makes a code path segment for the body part of a WhileStatement.

@returns {void}
488926
function() {
			var context = this.loopContext;
			var choiceContext = this.choiceContext;
			var forkContext = this.forkContext;

			if (!choiceContext.processed) {
				choiceContext.trueForkContext.add(forkContext.head);
				choiceContext.falseForkContext.add(forkContext.head);
			}

			// Update state.
			if (context.test !== true) {
				context.brokenForkContext.addAll(choiceContext.falseForkContext);
			}
			forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1));
		}
170085
function(node) {
			this.currentNode = node;

			// Updates the code path due to node's position in its parent node.
			if (node.parent) {
				preprocess(this, node);
			}

			// Updates the code path.
			// And emits onCodePathStart/onCodePathSegmentStart events.
			processCodePathToEnter(this, node);

			// Emits node events.
			this.original.enterNode(node);

			this.currentNode = null;
		}
207442
function () {
    // String must start with a backtick.
    if (!state.option.esnext || this.peek() !== "`") {
      return null;
    }

    var startLine = this.line;
    var startChar = this.char;
    var jump = 1;
    var value = "";

    // For now, do not perform any linting of the content of the template
    // string. Just skip until the next backtick is found.
    this.skip();

    while (this.peek() !== "`") {
      while (this.peek() === "") {
        // End of line --- For template literals in ES6, no backslash is
        // required to precede newlines.
        if (!this.nextLine()) {
          this.trigger("error", {
            code: "E052",
            line: startLine,
            character: startChar
          });

          return {
            type: Token.TemplateLiteral,
            value: value,
            isUnclosed: true
          };
        }
        value += "\n";
      }

      // TODO: do more interesting linting here, similar to string literal
      // linting.
      var char = this.peek();
      this.skip(jump);
      value += char;
    }

    this.skip();
    return {
      type: Token.TemplateLiteral,
      value: value,
      isUnclosed: false
    };
  }
1221694
function buildForXStatement(op) {
  return function (node, print) {
    this.keyword("for");
    this.push("(");
    print.plain(node.left);
    this.push(" " + op + " ");
    print.plain(node.right);
    this.push(")");
    print.block(node.body);
  };
}
287973
function parseScriptBody() {
        var statement, body = [], token, directive, firstRestricted;

        while (startIndex < length) {
            token = lookahead;
            if (token.type !== Token.StringLiteral) {
                break;
            }

            statement = parseStatementListItem();
            body.push(statement);
            if (statement.expression.type !== Syntax.Literal) {
                // this is not directive
                break;
            }
            directive = source.slice(token.start + 1, token.end - 1);
            if (directive === 'use strict') {
                strict = true;
                if (firstRestricted) {
                    tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
                }
            } else {
                if (!firstRestricted && token.octal) {
                    firstRestricted = token;
                }
            }
        }

        while (startIndex < length) {
            statement = parseStatementListItem();
            /* istanbul ignore if */
            if (typeof statement === 'undefined') {
                break;
            }
            body.push(statement);
        }
        return body;
    }
665959
function(query) {
    var qparts = getQueryParts(goog.string.trim(query));

    // if it's trivial, avoid iteration and zipping costs
    if (qparts.length == 1) {
      // We optimize this case here to prevent dispatch further down the
      // chain, potentially slowing things down. We could more elegantly
      // handle this in filterDown(), but it's slower for simple things
      // that need to be fast (e.g., '#someId').
      var tef = getElementsFunc(qparts[0]);
      return function(root) {
        var r = tef(root, []);
        if (r) { r.nozip = true; }
        return r;
      }
    }

    // otherwise, break it up and return a runner that iterates over the parts
    // recursively
    return function(root) {
      return filterDown(root, qparts);
    }
  }
1303723
private static int copyPathFragment(char[] input, int beginIndex, StringBuilder output)
	{
		int inputCharIndex = beginIndex;
		while (inputCharIndex < input.length)
		{
			final char inputChar = input[inputCharIndex];
			if (inputChar == '/')
			{
				break;
			}

			output.append(inputChar);
			inputCharIndex += 1;
		}

		return inputCharIndex;
	}
478392
function mapLoops(node, path, down) {
        var depth = node.$depth;
        if (node.type === 'ForInStatement' && containsAwait(node)) {
            transformForIn(node, path);
        } else if (node.type === 'ForOfStatement' && containsAwait(node)) {
            iterizeForOf(node, path);
        }
        // Are we inside a loop that has already been asynchronized and is labelled?
        var inAsyncLoop = path.some(function (p) {
            return '$label' in p.self && p.self.type === 'ForStatement' && p.self.$mapped;
        });
        // Check if the loop contains an await, or a labelled exit if we're inside an async loop
        function mappableLoop(n) {
            return n.type === 'AwaitExpression' && !n.$hidden || inAsyncLoop && (n.type === 'BreakStatement' || n.type === 'ContinueStatement') && n.label;
        }
        
        if (!node.$mapped && examine(node).isLoop && contains(node, mappableLoop)) {
            path[0].self.$mapped = true;
            var p;
            var mapped = [];
            var init = node.init;
            var test = node.test || literal(true);
            var step = node.update;
            var body = node.body;
            var localised = init && init.type === 'VariableDeclaration' && (init.kind === 'let' || init.kind === 'const');
            if (localised) {
                init.kind = 'let';
            }
            if (step) {
                step = {
                    type: 'ExpressionStatement',
                    expression: step
                };
            }
            if (init) {
                if (!examine(init).isStatement) {
                    init = {
                        type: 'ExpressionStatement',
                        expression: init
                    };
                }
                if (!localised) 
                    mapped.push(init);
            }
            var ref, label;
            if (node.$label) {
                label = node.$label.name;
                ref = path[1];
            } else {
                label = generatedSymbol++;
                ref = path[0];
            }
            label = opts.generatedSymbolPrefix + "Loop_" + label;
            var idLocal = localised ? ident(label + "_local"):null ;
            var idTrampoline = ident(label + "_trampoline");
            var idIter = ident(label);
            var idStep = step ? ident(label + "_step") : idIter;
            var idContinuation = ident(label + "_exit");
            var idBounce = ident("q");
            var idCatchParam = ident("$exception");
            var continuation, deferredCode;
            if ('index' in ref) {
                var idx = ref.index;
                deferredCode = ref.parent[ref.field].splice(idx + 1, ref.parent[ref.field].length - (idx + 1));
            } else {
                deferredCode = [];
            }
            continuation = makeContinuation(idContinuation, deferredCode);
            var initIter = localised ? parsePart("$0.bind(this,$1)", [idIter,init ? init.declarations.map(function (d) {
                return d && d.init ? d.init : ident("undefined");
            }) : []]).expr : idIter;
            var returnStep = parsePart("return $0", [idStep]).body[0];
            var returnBreak = {
                type: 'ReturnStatement',
                argument: {
                    "type": "ArrayExpression",
                    "elements": [literal(1)]
                }
            };
            treeWalk(body, function mapExits(n, descend, subpath) {
                if (examine(n).isFunction || examine(n).isLoop) {
                    return true;
                } else if (n.type === 'BreakStatement' || n.type === 'ContinueStatement') {
                    if (n.label) {
                        var labelStack = subpath.filter(function (p) {
                            return '$label' in p.self;
                        }).map(function (p, idx) {
                            return p.self.$label && p.self.$label.name;
                        });
                        // Work out how many loops to exit by examining subpath.
                        var loops = [];
                        for (var l = 0;l < labelStack.length; l++) {
                            if (labelStack[l] === n.label.name) {
                                if (n.type === 'BreakStatement') 
                                    loops.push(literal(1));
                                subpath[0].replace({
                                    type: 'ReturnStatement',
                                    argument: {
                                        "type": "ArrayExpression",
                                        "elements": loops.reverse()
                                    }
                                });
                                break;
                            }
                            loops.push(literal(0));
                        }
                    } else {
                        if (n.type === 'BreakStatement') 
                            subpath[0].replace(returnBreak);
                         else 
                            subpath[0].replace(returnStep); //  continue;
                    }
                } else {
                    descend();
                }
            }, path);
            if (body.type === 'BlockStatement') 
                body = body.body.slice(0);
             else 
                body = [body];
            if (node.type === 'DoWhileStatement') {
                body = body.concat({
                    "type": "IfStatement",
                    "test": {
                        type: 'UnaryExpression',
                        argument: test,
                        prefix: true,
                        operator: '!'
                    },
                    "consequent": returnBreak,
                    alternate: returnStep
                });
            } else {
                body = [{
                    "type": "IfStatement",
                    "test": test,
                    "consequent": {
                        "type": "BlockStatement",
                        "body": body.concat(returnStep)
                    },
                    alternate: returnBreak
                }];
            }
            var decls = [];
            if (opts.noRuntime) 
                decls.push({
                "type": "VariableDeclarator",
                "id": idTrampoline
            });
            if (step && localised) 
                decls.push({
                "type": "VariableDeclarator",
                "id": idLocal
            });
            if (decls.length) 
                mapped.push({
                "type": "VariableDeclaration",
                "declarations": decls,
                "kind": "var"
            });
            var invokeIterate;
            var exit = getExit(path, [opts]).$error;
            if (opts.noRuntime) {
                invokeIterate = parsePart(
	                opts.es6target?
	                    "($idTrampoline = ((q) => { "+
	                    "    $$setMapped: while (q) { "+
	                    "         if (q.then)  "+
	                    (depth===1?
	                    "             return void q.then($idTrampoline, $exit); ":
	                    "             return q.then($idTrampoline, $exit); ")+
	                    "         try { "+
	                    "             if (q.pop)  "+
	                    "                 if (q.length)  "+
	                    "                 return q.pop() ? $idContinuation.call(this) : q; "+
	                    "              else  "+
	                    "                 q = $idStep; "+
	                    "              else  "+
	                    "                 q = q.call(this) "+
	                    "          } catch (_exception) { "+
	                    "             return $exit(_exception); "+
	                    "          } "+
	                    "     } "+
	                    "}))($idIter)":
	                    "($idTrampoline = (function (q) { "+
	                    "    $$setMapped: while (q) { "+
	                    "         if (q.then)  "+
	                    (depth===1?
	                    "             return void q.then($idTrampoline, $exit); ":
	                    "             return q.then($idTrampoline, $exit); ")+
	                    "         try { "+
	                    "             if (q.pop)  "+
	                    "                 if (q.length)  "+
	                    "                 return q.pop() ? $idContinuation.call(this) : q; "+
	                    "              else  "+
	                    "                 q = $idStep; "+
	                    "              else  "+
	                    "                 q = q.call(this) "+
	                    "          } catch (_exception) { "+
	                    "             return $exit(_exception); "+
	                    "          } "+
	                    "     } "+
	                    "}).bind(this))($idIter)",
                {
                    setMapped: function (n) {
                        n.$mapped = true;
                        return n;
                    },
                    idTrampoline: idTrampoline,
                    exit: exit,
                    idIter: initIter,
                    idContinuation: idContinuation,
                    idStep: idStep
                }).expr;
            } else {
                invokeIterate = parsePart("($0.$1.trampoline(this,$2,$3,$4,$6)($5))", [opts.$runtime ? genIdent.runtime : ident('Function'),
                    genIdent.asyncbind,idContinuation,idStep,
                    exit,initIter,literal(depth === 1)]).expr;
            }
            var iterDecls = init && init.declarations ? init.declarations.map(function (d) {
                return d.id;
            }) : [];
            if (step) {
                var stepArgs = {
                    idIter: idIter,
                    idStep: idStep,
                    step: step,
                    idLocal: idLocal,
                    decId: iterDecls
                };
                if (localised) {
                    stepArgs.iterDecls = iterDecls;
                    mapped.push(parsePart(step.expression.$EmptyExpression ? 
                    		(opts.es6target ? "function $idStep(){ return $idIter.bind(this,...$idLocal()) }" : "function $idStep(){ var [$decId] = $idLocal(); return $idIter.bind(this,$decId) }") :
                    		"function $idStep(){ var [$decId] = $idLocal(); $:step; return $idIter.bind(this,$decId) }", stepArgs).body[0]);
                    body.unshift(parsePart("$idLocal = function(){ return [$decId] }", stepArgs).body[0]);
                } else {
                    mapped.push(parsePart(step.expression.$EmptyExpression ? "function $idStep(){ return $idIter }" : "function $idStep(){ $:step; return $idIter }", stepArgs).body[0]);
                }
            }
            mapped.push({
                $label: node.$label,
                "type": "FunctionDeclaration",
                "id": idIter,
                "params": localised ? iterDecls : [],
                "body": {
                    "type": "BlockStatement",
                    "body": body
                }
            });
            mapped.push({
                type: 'ReturnStatement',
                argument: invokeIterate
            });
            mapped.push(continuation);
            path[0].replace(mapped.map(down));
        }
    }
480861
function parseThrowStatement() {
        var argument;

        expectKeyword('throw');

        if (peekLineTerminator()) {
            throwError({}, Messages.NewlineAfterThrow);
        }

        argument = parseExpression();

        consumeSemicolon();

        return delegate.createThrowStatement(argument);
    }
967143
function parseWithStatement(node) {
        var object, body;

        if (strict) {
            tolerateError(Messages.StrictModeWith);
        }

        expectKeyword('with');

        expect('(');

        object = parseExpression();

        expect(')');

        body = parseStatement();

        return node.finishWithStatement(object, body);
    }
190846
function parseWithStatement() {
        var object, body;

        if (strict) {
            // TODO(ikarienator): Should we update the test cases instead?
            skipComment();
            throwErrorTolerant({}, Messages.StrictModeWith);
        }

        expectKeyword('with');

        expect('(');

        object = parseExpression();

        expect(')');

        body = parseStatement();

        return delegate.createWithStatement(object, body);
    }
825170
function isInsideWithStatementBody(node) {
            if (node) {
                while (node.parent) {
                    if (node.parent.kind === 212 /* WithStatement */ && node.parent.statement === node) {
                        return true;
                    }
                    node = node.parent;
                }
            }
            return false;
        }
635395
function enterBreakableStatement(node) {
            scopeInfo = {
                label: node.parent.type === "LabeledStatement" ? node.parent.label : null,
                breakable: true,
                upper: scopeInfo
            };
        }
1267998
private ParseTree parseWhileStatement() {
    SourcePosition start = getTreeStartLocation();
    eat(TokenType.WHILE);
    eat(TokenType.OPEN_PAREN);
    ParseTree condition = parseExpression();
    eat(TokenType.CLOSE_PAREN);
    ParseTree body = parseStatement();
    return new WhileStatementTree(getTreeLocation(start), condition, body);
  }
485930
private final While whileStatement(Data data) throws TemplateException {
	int pos = data.srcCode.getPos();

	// id
	String id = variableDec(data, false);
	if (id == null) {
	    data.srcCode.setPos(pos);
	    return null;
	}
	if (id.equalsIgnoreCase("while")) {
	    id = null;
	    data.srcCode.removeSpace();
	    if (!data.srcCode.forwardIfCurrent('(')) {
		data.srcCode.setPos(pos);
		return null;
	    }
	}
	else {
	    data.srcCode.removeSpace();
	    if (!data.srcCode.forwardIfCurrent(':')) {
		data.srcCode.setPos(pos);
		return null;
	    }
	    data.srcCode.removeSpace();

	    if (!data.srcCode.forwardIfCurrent("while", '(')) {
		data.srcCode.setPos(pos);
		return null;
	    }
	}

	Position line = data.srcCode.getPosition();
	Body body = new BodyBase(data.factory);
	While whil = new While(condition(data), body, line, null, id);

	if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "while statement must end with a [)]");

	Body prior = data.setParent(body);
	statement(data, body, CTX_WHILE);
	data.setParent(prior);

	whil.setEnd(data.srcCode.getPosition());
	return whil;
    }
1326901
function printParsableCode(snippets) {
  // prints all lines, some of which were fixed to make them parsable
  var lines = snippets
    .map(function (x) { return '[ ' + x.code + ' ]'; });

  console.log(lines.join('\n'));
}
248072
function leaveFromCurrentSegment(analyzer, node) {
    const state = CodePath.getState(analyzer.codePath);
    const currentSegments = state.currentSegments;

    for (let i = 0; i < currentSegments.length; ++i) {
        const currentSegment = currentSegments[i];

        debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`);
        if (currentSegment.reachable) {
            analyzer.emitter.emit(
                "onCodePathSegmentEnd",
                currentSegment,
                node
            );
        }
    }

    state.currentSegments = [];
}