swiftlang/swift

Fill out unimplemented expression cases in the ASTPrinter

オープン

#61,601 opened on 2022/10/17

 (20 件のコメント) (5 件のリアクション) (0 人の担当者)Swift (10,719 件のフォーク)batch import
ASTPrintercompilerexpressionsgood first issue

Repository metrics

Stars
 (69,989 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

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