swiftlang/swift

Fill out unimplemented expression cases in the ASTPrinter

Open

#61,601 创建于 2022年10月17日

在 GitHub 查看
 (20 评论) (5 反应) (0 负责人)Swift (10,719 fork)batch import
ASTPrintercompilerexpressionsgood first issue

仓库指标

Star
 (69,989 star)
PR 合并指标
 (平均合并 8天 17小时) (30 天内合并 510 个 PR)

描述

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

贡献者指南