Updated parser
This commit is contained in:
parent
66a0625382
commit
bdc062b33a
1248 changed files with 93128 additions and 102788 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/28 18:36:40 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/06/29 16:08:54 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/06/29 21:18:46 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -32,10 +32,10 @@ t_node *build_childs(t_parse_node parent, t_const_str input, t_usize count)
|
|||
idx = 0;
|
||||
while (idx < count)
|
||||
{
|
||||
child = ts_node_named_child(parent, idx);
|
||||
child = ts_node_child(parent, idx);
|
||||
ret[idx] = build_node(child, input);
|
||||
ret[idx].field_str = ts_node_field_name_for_child(parent, idx);
|
||||
ret[idx].field = ts_language_field_id_for_name(tree_sitter_bash(), ret[idx].field_str, str_len(ret[idx].field_str));
|
||||
ret[idx].field = ts_node_field_id_for_child(parent, idx);
|
||||
idx++;
|
||||
}
|
||||
return (ret);
|
||||
|
|
@ -53,7 +53,7 @@ t_node build_node(t_parse_node curr, t_const_str input)
|
|||
out.single_str = NULL;
|
||||
out.field_str = NULL;
|
||||
out.field = 0;
|
||||
out.childs_count = ts_node_named_child_count(curr);
|
||||
out.childs_count = ts_node_child_count(curr);
|
||||
if (out.childs_count == 0)
|
||||
out.childs = NULL;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue