1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Capture node names, not strings.

This commit is contained in:
Rob Rix 2015-10-27 18:09:30 -04:00
parent 52a63856a8
commit 3f61255915

View File

@ -43,7 +43,7 @@ if let a = arguments[1] {
print(Cofree<String, TSNode>.ana { node in
let count = ts_node_child_count(node)
guard count > 0 else {
return String.fromCString(ts_node_string(node, document)).map(Syntax.Leaf)!
return String.fromCString(ts_node_name(node, document)).map(Syntax.Leaf)!
}
return .Indexed((0..<count).map { ts_node_child(node, $0) })
} (root))