Skip to content

Commit

Permalink
fix python SelectItem generation
Browse files Browse the repository at this point in the history
  • Loading branch information
johnynek committed Oct 2, 2023
1 parent e90e487 commit 8e5315f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8e5315f

Please sign in to comment.