emacs-devel
[Top][All Lists]
Advanced

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

Re: parser error recovery algorithm vs treesit indentation "blinking"


From: Stephen Leake
Subject: Re: parser error recovery algorithm vs treesit indentation "blinking"
Date: Tue, 04 Apr 2023 09:00:16 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

Dmitry Gutov <dgutov@yandex.ru> writes:

> Here's a relevant discussion, but there's nothing about positions in
> there: https://github.com/tree-sitter/tree-sitter/issues/224

Ah. So tree-sitter does do some insertion, but not as much as wisitoken
wisitoken is also GLR, and uses the same approach to multiple error
correction solutions, although the cost of insert/delete depends on the
token; for example, it's cheaper to insert or delete parentheses, since
they are often missing or extra while editing.

I've posted a draft paper on the wisitoken error correction algorithm;
https://stephe-leake.org/ada/error_correction_algorithm.pdf

In the full algorithm used by ada-mode, there is some consideration
about whether to insert tokens before or after new-lines, to address the
indent issue you describe.

-- 
-- Stephe



reply via email to

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