mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +03:00
Reformat.
This commit is contained in:
parent
3f61255915
commit
76a67a7d8e
@ -40,13 +40,16 @@ if let a = arguments[1] {
|
||||
ts_document_parse(document)
|
||||
let root = ts_document_root_node(document)
|
||||
|
||||
print(Cofree<String, TSNode>.ana { node in
|
||||
let count = ts_node_child_count(node)
|
||||
guard count > 0 else {
|
||||
return String.fromCString(ts_node_name(node, document)).map(Syntax.Leaf)!
|
||||
}
|
||||
return .Indexed((0..<count).map { ts_node_child(node, $0) })
|
||||
} (root))
|
||||
let term = Cofree<String, TSNode>
|
||||
.ana { node in
|
||||
let count = ts_node_child_count(node)
|
||||
guard count > 0 else {
|
||||
return String.fromCString(ts_node_name(node, document)).map(Syntax.Leaf)!
|
||||
}
|
||||
return .Indexed((0..<count).map { ts_node_child(node, $0) })
|
||||
} (root)
|
||||
|
||||
print(term)
|
||||
|
||||
ts_document_free(document)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user