Files
swift-mirror/lib/Syntax/Status.md
Xi Ge 50eb2e3531 [Doc] libSyntax: add a document describing the status of libSyntax node specialization. NFC
This document breaks all existing syntactic AST nodes into five categories:
expression, declaration, statement, pattern and typerepr. Nodes in each
category can be further defined as "specialized", "in-progress" and
"not-specialized".

The parser currently can recognize specialized nodes; for "in-progress"
and "not-specialized" nodes, the parser will wrap their underlying source
to be an unknown entity, e.g. UnknownDecl or UnknownStmt.

"in-progress" nodes are considered in a higher priority to be specialized
than "not-specialized" nodes. However, eventually all nodes should be
marked as "specialized".
2017-12-14 13:51:27 -08:00

2.1 KiB

libSyntax nodes status

Expression

Specialized:

  • NilLiteralExpr
  • IntegerLiteralExpr
  • FloatLiteralExpr
  • BooleanLiteralExpr
  • StringLiteralExpr
  • DiscardAssignmentExpr
  • DeclRefExpr
  • IfExpr
  • AssignExpr
  • TypeExpr
  • UnresolvedMemberExpr
  • SequenceExpr
  • TupleElementExpr
  • TupleExpr
  • ArrayExpr
  • DictionaryExpr
  • PrefixUnaryExpr
  • TryExpr
  • ForceTryExpr
  • OptionalTryExpr
  • ClosureExpr

In-progress (UnknownExpr):

  • InterpolatedStringLiteralExpr
  • ObjectLiteralExpr
  • MagicIdentifierLiteralExpr
  • CallExpr
  • UnresolvedDotExpr
  • InOutExpr
  • KeyPathExpr
  • KeyPathDotExpr
  • EditorPlaceholderExpr

Not-specialized (UnknownExpr):

  • SuperRefExpr
  • UnresolvedSpecializeExpr
  • DotSelfExpr
  • SubscriptExpr
  • KeyPathApplicationExpr
  • CaptureListExpr
  • AutoClosureExpr
  • DynamicTypeExpr
  • BindOptionalExpr
  • OptionalEvaluationExpr
  • ForceValueExpr
  • PostfixUnaryExpr
  • ForcedCheckedCastExpr
  • ConditionalCheckedCastExpr
  • IsExpr
  • CoerceExpr
  • ArrowExpr
  • UnresolvedPatternExpr
  • ObjCSelectorExpr

Declaration

Specialized:

  • TopLevelCodeDecl
  • StructDecl
  • FuncDecl
  • ProtocolDecl
  • ImportDecl

In-progress (UnknownDecl):

  • TypeAliasDecl
  • PatternBindingDecl
  • VarDecl
  • IfConfigDecl
  • ClassDecl (SR-6571)
  • ExtensionDecl (SR-6572)

Not-specialized (UnknownDecl):

  • EnumCaseDecl
  • PrecedenceGroupDecl
  • InfixOperatorDecl
  • PrefixOperatorDecl
  • PostfixOperatorDecl
  • AssociatedTypeDecl
  • EnumDecl
  • SubscriptDecl
  • ConstructorDecl
  • DestructorDecl
  • EnumElementDecl

Statement

Specialized:

  • BraceStmt
  • ReturnStmt

Not-specialized (UnknownStmt):

  • DeferStmt
  • IfStmt
  • GuardStmt
  • WhileStmt
  • DoStmt
  • DoCatchStmt
  • RepeatWhileStmt
  • ForEachStmt
  • SwitchStmt
  • CaseStmt
  • CatchStmt
  • BreakStmt
  • ContinueStmt
  • FallthroughStmt
  • FailStmt
  • ThrowStmt

Pattern

Not-specialized:

  • ParenPattern
  • TuplePattern
  • NamedPattern
  • AnyPattern
  • TypedPattern
  • VarPattern

TypeRepr

  • To-be filled