Package org.openrewrite.python.marker
Class PrintSyntax
java.lang.Object
org.openrewrite.python.marker.PrintSyntax
- All Implemented Interfaces:
org.openrewrite.marker.Marker,org.openrewrite.rpc.RpcCodec<PrintSyntax>
public class PrintSyntax
extends Object
implements org.openrewrite.marker.Marker, org.openrewrite.rpc.RpcCodec<PrintSyntax>
Marker indicating that a
J.MethodInvocation represents a Python 2 print statement
rather than a Python 3 print function call.
In Python 2, print is a statement:
print "hello" # simple print print >> stderr, "err" # print to file (hasDestination=true, first arg is destination) print x, # trailing comma suppresses newline
The marker allows the printer to output the correct syntax and allows recipes to distinguish between print statements and print function calls.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrpcReceive(PrintSyntax before, org.openrewrite.rpc.RpcReceiveQueue q) voidrpcSend(PrintSyntax after, org.openrewrite.rpc.RpcSendQueue q) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.marker.Marker
getId, print, withId
-
Constructor Details
-
PrintSyntax
public PrintSyntax()
-
-
Method Details
-
rpcSend
- Specified by:
rpcSendin interfaceorg.openrewrite.rpc.RpcCodec<PrintSyntax>
-
rpcReceive
- Specified by:
rpcReceivein interfaceorg.openrewrite.rpc.RpcCodec<PrintSyntax>
-