+ " \"Bar is a unit of pressure, roughly equal to the atmospheric pressure on Earth\"\n"
+ " def far(self):\n"
+ " The kingdom of FAR FAR Away, Donkey? That's where we're going! FAR! FAR!... away.\n";
helper.setup(new PathUtil("foo.py"), text, 0, 0, true);
final PyIndexUpdater analyzer = new PyIndexUpdater();
helper.parser.getListenerRegistrar().add(new DocumentParser.Listener() {
private boolean asyncParsing;
@Override
public void onIterationStart(int lineNumber) {
asyncParsing = true;
analyzer.onBeforeParse();
}
@Override
public void onIterationFinish() {
asyncParsing = false;
analyzer.onAfterParse();
}
@Override
public void onDocumentLineParsed(
Line line, int lineNumber, @Nonnull JsonArray<Token> tokens) {
if (asyncParsing) {
TaggableLine previousLine = TaggableLineUtil.getPreviousLine(line);
analyzer.onParseLine(previousLine, line, tokens);
}
}
});
helper.parser.begin();