From 8e5315fda57e560f4c651518dd986b3d4391f735 Mon Sep 17 00:00:00 2001 From: Patrick Oscar Boykin Date: Sun, 1 Oct 2023 16:32:54 -1000 Subject: [PATCH] fix python SelectItem generation --- core/src/main/scala/org/bykn/bosatsu/codegen/python/Code.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/org/bykn/bosatsu/codegen/python/Code.scala b/core/src/main/scala/org/bykn/bosatsu/codegen/python/Code.scala index 18c5015ad..7e54895cb 100644 --- a/core/src/main/scala/org/bykn/bosatsu/codegen/python/Code.scala +++ b/core/src/main/scala/org/bykn/bosatsu/codegen/python/Code.scala @@ -127,7 +127,7 @@ object Code { case Parens(inner@Parens(_)) => exprToDoc(inner) case Parens(p) => par(exprToDoc(p)) case SelectItem(x, i) => - maybePar(x) + Doc.char('[') + Doc.str(i) + Doc.char(']') + maybePar(x) + Doc.char('[') + exprToDoc(i) + Doc.char(']') case SelectRange(x, os, oe) => val middle = os.fold(Doc.empty)(exprToDoc) + Doc.char(':') + oe.fold(Doc.empty)(exprToDoc) maybePar(x) + (Doc.char('[') + middle + Doc.char(']')).nested(4)