File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,15 @@ impl<'tree> Node<'tree> {
112112 unsafe { ts_node_is_missing ( self . as_raw ( ) ) }
113113 }
114114
115+ /// Check if this node is *extra*.
116+ ///
117+ /// Extra nodes represent things like comments, which are not required by the
118+ /// grammar, but can appear anywhere.
119+ #[ inline]
120+ pub fn is_extra ( & self ) -> bool {
121+ unsafe { ts_node_is_extra ( self . as_raw ( ) ) }
122+ }
123+
115124 /// Get the byte offsets where this node starts.
116125 #[ inline( always) ]
117126 pub fn start_byte ( & self ) -> u32 {
@@ -285,6 +294,12 @@ extern "C" {
285294 /// in order to recover from certain kinds of syntax errors
286295 fn ts_node_is_missing ( node : NodeRaw ) -> bool ;
287296
297+ /// Check if this node is *extra*.
298+ ///
299+ /// Extra nodes represent things like comments, which are not required by the
300+ /// grammar, but can appear anywhere.
301+ fn ts_node_is_extra ( node : NodeRaw ) -> bool ;
302+
288303 /// Get the node's immediate parent
289304 fn ts_node_parent ( node : NodeRaw ) -> NodeRaw ;
290305
You can’t perform that action at this time.
0 commit comments