@@ -65,12 +65,12 @@ pub fn main() !void {
65
65
try parser.setLanguage(language);
66
66
67
67
// Parse some source code and get the root node
68
- const tree = try parser.parseBuffer ("pub fn main() !void {}", null , null);
69
- defer tree.destroy();
68
+ const tree = parser.parseString ("pub fn main() !void {}", null);
69
+ defer tree.?. destroy();
70
70
71
- const node = tree.rootNode();
72
- std.debug.assert(std.mem.eql(u8, node.type (), "source_file"));
73
- std.debug.assert(node.endPoint().cmp(.{ .row = 0, .column = 22 }) == 0 );
71
+ const node = tree.?. rootNode();
72
+ std.debug.assert(std.mem.eql(u8, node.kind (), "source_file"));
73
+ std.debug.assert(node.endPoint().cmp(.{ .row = 0, .column = 22 }) == .eq );
74
74
75
75
// Create a query and execute it
76
76
var error_offset: u32 = 0;
@@ -84,7 +84,7 @@ pub fn main() !void {
84
84
// Get the captured node of the first match
85
85
const match = cursor.nextMatch().?;
86
86
const capture = match.captures[0].node;
87
- std.debug.assert(std.mem.eql(u8, capture.type (), "identifier"));
87
+ std.debug.assert(std.mem.eql(u8, capture.kind (), "identifier"));
88
88
}
89
89
```
90
90
0 commit comments