Skip to content

Commit

Permalink
Merge pull request #64 from openrewrite/requirePrintEqualsInput
Browse files Browse the repository at this point in the history
Call `requirePrintEqualsInput` from `PythonParser#parseInputs`
  • Loading branch information
jkschneider authored Aug 5, 2023
2 parents f9d1b4e + 5daaafb commit 177f72d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/openrewrite/python/PythonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ public Stream<SourceFile> parseInputs(Iterable<Input> inputs, @Nullable Path rel
ParsingExecutionContextView pctx = ParsingExecutionContextView.view(ctx);
ParsingEventListener parsingListener = pctx.getParsingListener();

return acceptedInputs(inputs).map(sourceFile -> {
Path path = sourceFile.getRelativePath(relativeTo);
try (EncodingDetectingInputStream is = sourceFile.getSource(ctx)) {
return acceptedInputs(inputs).map(input -> {
Path path = input.getRelativePath(relativeTo);
try (EncodingDetectingInputStream is = input.getSource(ctx)) {
Py.CompilationUnit py = new PsiPythonMapper(path, is.getCharset(), is.isCharsetBomMarked(), styles, mapLanguageLevel(languageLevel))
.mapSource(is.readFully());
parsingListener.parsed(sourceFile, py);
return py;
parsingListener.parsed(input, py);
return requirePrintEqualsInput(py, input, relativeTo, ctx);
} catch (Throwable t) {
ctx.getOnError().accept(t);
return ParseError.build(this, sourceFile, relativeTo, ctx, t);
return ParseError.build(this, input, relativeTo, ctx, t);
}
});
}
Expand Down

0 comments on commit 177f72d

Please sign in to comment.