Slide 27
Slide 27 text
import SwiftSyntax
let url = URL(fileURLWithPath: "example.swift")
let source = try String(contentsOf: url)
let syntax = try SyntaxParser.parse(source: source)
let stmts = Array(syntax.statements)
guard let ifStmt = stmts.first?.item as? IfStmtSyntax else {
print("If statement not found at the position.")
return
}
JGจগ͠ख͕ؒͩ͜ͷΑ͏ʹऔΕΔɻ࣮ࡍͷߏจΛEVNQ͢ΔͱΘ͔Δ
JGจ·ͰͷऔΓํ
27
ൃ
ද
Ͱ
ল
ུ