-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: change Node pointers to values #21
base: master
Are you sure you want to change the base?
refactor: change Node pointers to values #21
Conversation
b4b762c
to
0e66c09
Compare
@@ -713,7 +713,7 @@ func (qc *QueryCursor) DidExceedMatchLimit() bool { | |||
// captures. Because multiple patterns can match the same set of nodes, | |||
// one match may contain captures that appear *before* some of the | |||
// captures from a previous match. | |||
func (qc *QueryCursor) Matches(query *Query, node *Node, text []byte) QueryMatches { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if you also intended me to change this
@@ -737,7 +737,7 @@ func (qc *QueryCursor) Matches(query *Query, node *Node, text []byte) QueryMatch | |||
// | |||
// This is useful if you don't care about which pattern matched, and just | |||
// want a single, ordered sequence of captures. | |||
func (qc *QueryCursor) Captures(query *Query, node *Node, text []byte) QueryCaptures { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if you also intended me to change this
func (t *Tree) RootNodeWithOffset(offsetBytes int, offsetExtent Point) *Node { | ||
return &Node{_inner: C.ts_tree_root_node_with_offset(t._inner, C.uint(offsetBytes), offsetExtent.toTSPoint())} | ||
func (t *Tree) RootNodeWithOffset(offsetBytes int, offsetExtent Point) Node { | ||
return Node{_inner: C.ts_tree_root_node_with_offset(t._inner, C.uint(offsetBytes), offsetExtent.toTSPoint())} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if you also intended me to change this
func (t *Tree) RootNode() *Node { | ||
return &Node{_inner: C.ts_tree_root_node(t._inner)} | ||
func (t *Tree) RootNode() Node { | ||
return Node{_inner: C.ts_tree_root_node(t._inner)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if you also intended me to change this
0e66c09
to
839edd6
Compare
This changes the method receivers of the
Node
type to values instead of pointers for non mutating methods & pointer return type as discussed in #19 (comment)