~/talk

Making Your Own Tools Using SwiftSyntax

Talkat /dev/world 2019 · 2019-09-26..09-27· [swift]
github:kitasuke
slides:none on file

SwiftSyntax (installed via SPM) parses Swift source into a libSyntax tree and allows precise inspection and transformation using SyntaxParser via SPM, SyntaxVisitor/SyntaxRewriter and SyntaxFactory. Concrete tools built: SwiftConst to find repeated string literals, a SwiftASTExplorer HTML viewer for JSON trees, an odd-number inspector that prints warnings for odd integer literals, and a formatter that rewrites integer literals (multiplies by 10). Each tool uses the parsed tokens and visitor/rewriter flow and runs successfully on example projects; performance and function-builder creation are improving.

AI-written summary · about

  1. 0:00Introduction to Swift syntax
  2. 2:24Existing tools and usage
  3. 5:13Understanding syntax trees
  4. 8:19Emitting and viewing syntax
  5. 11:01Core components and setup
  6. 17:40Visitors and factories
  7. 21:21Practical implementation
  8. 26:46Future outlook and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.