as(_:)

Attempts to cast the current syntax node to a given specialized syntax type.

SyntaxProtocol.swift:88
func `as`<S>(_ syntaxType: S.Type) -> S? where S : SyntaxProtocol

Returns

An instance of the specialized type, or nil if the cast fails.