swiftlang/swift

Fill out unimplemented expression cases in the ASTPrinter

Open

#61,601 opened on 2022年10月17日

GitHub で見る
 (20 comments) (5 reactions) (0 assignees)Swift (10,719 forks)batch import
ASTPrintercompilerexpressionsgood first issue

Repository metrics

Stars
 (69,989 stars)
PR merge metrics
 (平均マージ 8d 17h) (30d で 510 merged PRs)

説明

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

コントリビューターガイド