bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum recursio


From: Yuan Fu
Subject: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum recursion limit
Date: Sat, 26 Nov 2022 18:36:45 -0800


> On Nov 24, 2022, at 11:28 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Thu, 24 Nov 2022 11:25:58 -0800
>> Cc: Eli Zaretskii <eliz@gnu.org>,
>> Po Lu <luangruo@yahoo.com>,
>> Stefan Kangas <stefankangas@gmail.com>,
>> 59426@debbugs.gnu.org
>> 
>> That brings us back to the original question: what limit should we use? I 
>> suggest we use a smaller number since normal tree should never be very tall. 
>> Running the following code tells me the height of the tree for xdisp.c is 30:
>> 
>> (defun measure-height (node)
>>  (let ((children (treesit-node-children node t)))
>>    (if children
>>        (1+ (apply #'max (mapcar #'measure-height children)))
>>      1)))
>> ;; In xdisp.c:
>> (measure-height (treesit-buffer-root-node))
>> 
>> Maybe a limit in the range of hundreds or thousands? 800?
> 
> I suggest 1000.

Ok, I added the default limit in cc086f37e89.

Yuan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]