[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generic stack I can use in C core?
From: |
Eli Zaretskii |
Subject: |
Re: Generic stack I can use in C core? |
Date: |
Sat, 24 Sep 2022 09:11:24 +0300 |
> From: Yuan Fu <casouri@gmail.com>
> Date: Fri, 23 Sep 2022 14:56:23 -0700
> Cc: emacs-devel@gnu.org
>
> >> *Something that allocates a chunk of memory to store the nodes and
> >> automatically grows and shrinks and copies stuff over.
> >
> > What kind of stuff do you want to store there?
>
> I want to traverse a tree depth-first using stacks. If there is a generic
> stack I’ll use that, if not I’ll just use
>
> struct stack_node {
> TSNode node;
> TSNode *next;
> };
Then I don't think we have anything ready for that, no. In the couple
of places where we traverse a tree in depth-first order, we just
recurse.