Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Provide a shortcut function to get Name in Semantic mode #366

Open
vmarkovtsev opened this issue Feb 17, 2019 · 0 comments
Open

Provide a shortcut function to get Name in Semantic mode #366

vmarkovtsev opened this issue Feb 17, 2019 · 0 comments

Comments

@vmarkovtsev
Copy link

Having obtained function names in #365 I need to get the actual strings. My current take is

nodeName, err := tools.FilterNode(node, "//uast:Function/../../Name")
if err != nil {
	return nil, err
}
println(string(nodeName.(nodes.Object)["Name"].(nodes.String)))

I have to hardcode "Name" and do two type assertions. Is it possible to add a wrapper?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant