Class ExecSyntax

java.lang.Object
org.openrewrite.python.marker.ExecSyntax
All Implemented Interfaces:
org.openrewrite.marker.Marker, org.openrewrite.rpc.RpcCodec<ExecSyntax>

public class ExecSyntax extends Object implements org.openrewrite.marker.Marker, org.openrewrite.rpc.RpcCodec<ExecSyntax>
Marker indicating that a J.MethodInvocation represents a Python 2 exec statement rather than a Python 3 exec function call.

In Python 2, exec is a statement with optional scope arguments:

 exec code                    # simple form
 exec code in globals         # with globals dict
 exec code in globals, locals # with globals and locals dicts
 

The marker allows the printer to output the correct syntax (using in keyword instead of function arguments) and allows recipes to distinguish between exec statements and exec function calls.

  • Constructor Details

    • ExecSyntax

      public ExecSyntax()
  • Method Details

    • rpcSend

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

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