diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-10-05 18:47:04 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-10-05 18:47:04 +0100 |
| commit | e44bf2c9e4108ab69a599acdbbf54a02b6984a07 (patch) | |
| tree | 12b6c7f1cd51f4349706107ffa0f840843eec6fa /src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java | |
| parent | 6207aa4f7d53fd3cd7a27aa35a3d261ad67afee5 (diff) | |
Use slice syntax instead of __getitem__
Diffstat (limited to 'src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java')
| -rw-r--r-- | src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java b/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java index 32d4272..67f66ea 100644 --- a/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java +++ b/src/main/java/org/zwobble/couscous/backends/python/PrimitiveMethods.java @@ -11,8 +11,8 @@ import org.zwobble.couscous.values.TypeReference; import com.google.common.collect.ImmutableMap; import static java.util.Arrays.asList; -import static org.zwobble.couscous.backends.python.ast.PythonAttributeAccessNode.pythonAttributeAccess; import static org.zwobble.couscous.backends.python.ast.PythonCallNode.pythonCall; +import static org.zwobble.couscous.backends.python.ast.PythonGetSliceNode.pythonGetSlice; import static org.zwobble.couscous.backends.python.ast.PythonVariableReferenceNode.pythonVariableReference; public class PrimitiveMethods { @@ -25,13 +25,7 @@ public class PrimitiveMethods { asList(receiver))) .put("substring", (receiver, arguments) -> - pythonCall( - pythonAttributeAccess( - receiver, - "__getitem__"), - asList(pythonCall( - pythonVariableReference("slice"), - arguments)))) + pythonGetSlice(receiver, arguments)) .build(); |
