swiftlang/swift

Fill out unimplemented expression cases in the ASTPrinter

Open

#61 601 ouverte le 17 oct. 2022

Voir sur GitHub
 (20 commentaires) (5 réactions) (0 assignés)Swift (10 719 forks)batch import
ASTPrintercompilerexpressionsgood first issue

Métriques du dépôt

Stars
 (69 989 stars)
Métriques de merge PR
 (Merge moyen 8j 17h) (510 PRs mergées en 30 j)

Description

In #40691 we added initial support for printing Expr nodes in the ASTPrinter, and #64667 filled out most of the rest. However there are still some expressions left unimplemented, including:

  • All the ImplicitConversionExpr subclasses, we should stamp out their definitions as printing their sub-expression, using a macro
  • InterpolatedStringLiteralExpr (this is a tricky case since we'd need to reconstruct the string literal from the TapExpr, or otherwise preserve its original form)

These are partially implemented, with outstanding FIXMEs:

  • ClosureExpr
  • CaptureListExpr
  • KeyPathExpr

Some extras tests would be good for:

  • SubscriptExpr (would be great to have a test exercising some other call patterns, e.g multiple arguments, argument labels)
  • TupleElementExpr
  • ObjCSelectorExpr
  • DynamicSubscriptExpr
  • EnumIsCaseExpr
  • MakeTemporarilyEscapableExpr
  • EditorPlaceholderExpr
  • DotSyntaxBaseIgnoredExpr

Guide contributeur