Document document = Document.createFromString(text);
Line line = document.getFirstLine();
TaggableLine previousLine;
JsonArray<Token> tokens1 = JsonCollections.createArray();
tokens1.add(new Token(mode, TokenType.KEYWORD, "function"));
tokens1.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens1.add(new Token(mode, TokenType.VARIABLE, "a"));
tokens1.add(new Token(mode, TokenType.NULL, "("));
tokens1.add(new Token(mode, TokenType.VARIABLE, "b"));
tokens1.add(new Token(mode, TokenType.NULL, ","));
tokens1.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens1.add(new Token(mode, TokenType.VARIABLE, "c"));
tokens1.add(new Token(mode, TokenType.NULL, ")"));
tokens1.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens1.add(new Token(mode, TokenType.NULL, "{"));
tokens1.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsonArray<Token> tokens2 = JsonCollections.createArray();
tokens2.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens2.add(new Token(mode, TokenType.VARIABLE, "d"));
tokens2.add(new Token(mode, TokenType.NULL, "."));
tokens2.add(new Token(mode, TokenType.VARIABLE, "prototype"));
tokens2.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens2.add(new Token(mode, TokenType.NULL, "="));
tokens2.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens2.add(new Token(mode, TokenType.KEYWORD, "function"));
tokens2.add(new Token(mode, TokenType.NULL, "("));
tokens2.add(new Token(mode, TokenType.NULL, ")"));
tokens2.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens2.add(new Token(mode, TokenType.NULL, "{"));
tokens2.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsonArray<Token> tokens3 = JsonCollections.createArray();
tokens3.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens3.add(new Token(mode, TokenType.NULL, "}"));
tokens3.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsonArray<Token> tokens4 = JsonCollections.createArray();
tokens4.add(new Token(mode, TokenType.NULL, "}"));
tokens4.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsonArray<Token> tokens5 = JsonCollections.createArray();
tokens5.add(new Token(mode, TokenType.KEYWORD, "var"));
tokens5.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens5.add(new Token(mode, TokenType.DEF, "e"));
tokens5.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens5.add(new Token(mode, TokenType.NULL, "="));
tokens5.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens5.add(new Token(mode, TokenType.NULL, "{"));
tokens5.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsonArray<Token> tokens6 = JsonCollections.createArray();
tokens6.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens6.add(new Token(mode, TokenType.PROPERTY, "f"));
tokens6.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens6.add(new Token(mode, TokenType.NULL, ":"));
tokens6.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens6.add(new Token(mode, TokenType.KEYWORD, "function"));
tokens6.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens6.add(new Token(mode, TokenType.NULL, "("));
tokens6.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens6.add(new Token(mode, TokenType.NULL, ")"));
tokens6.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens6.add(new Token(mode, TokenType.NULL, "{"));
tokens6.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsonArray<Token> tokens7 = JsonCollections.createArray();
tokens7.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens7.add(new Token(mode, TokenType.VARIABLE, "callMyFunctionWithCallback"));
tokens7.add(new Token(mode, TokenType.NULL, "("));
tokens7.add(new Token(mode, TokenType.KEYWORD, "function"));
tokens7.add(new Token(mode, TokenType.NULL, "("));
tokens7.add(new Token(mode, TokenType.COMMENT, "/* Knock-knock! */"));
tokens7.add(new Token(mode, TokenType.NULL, ")"));
tokens7.add(new Token(mode, TokenType.WHITESPACE, " "));
tokens7.add(new Token(mode, TokenType.NULL, "{"));
tokens7.add(new Token(mode, TokenType.NEWLINE, "\n"));
JsIndexUpdater indexUpdater = new JsIndexUpdater();
indexUpdater.onBeforeParse();
previousLine = TaggableLineUtil.getPreviousLine(line);