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 Details

    • PrintSyntax

      public PrintSyntax()
  • Method Details

    • rpcSend

      public void rpcSend(PrintSyntax after, org.openrewrite.rpc.RpcSendQueue q)
      Specified by:
      rpcSend in interface org.openrewrite.rpc.RpcCodec<PrintSyntax>
    • rpcReceive

      public PrintSyntax rpcReceive(PrintSyntax before, org.openrewrite.rpc.RpcReceiveQueue q)
      Specified by:
      rpcReceive in interface org.openrewrite.rpc.RpcCodec<PrintSyntax>