[Top][All Lists]

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

Re: New optimisations for long raw strings in C++ Mode.

From: Eli Zaretskii
Subject: Re: New optimisations for long raw strings in C++ Mode.
Date: Thu, 11 Aug 2022 20:15:17 +0300

> Date: Thu, 11 Aug 2022 16:54:47 +0000
> Cc: gregory@heytings.org, larsi@gnus.org, emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> > We know that fontifications are incorrect, and where strings or
> > comments start or end immediately, just after a single glance.  We
> > never need to go to BOB to find that out.
> Before the days of font-locking in editors, a standard problem was when a
> comment didn't end where the user thought it did, for lack of a comment
> ender.  There was a particular problem in Pascal (whose precise details
> aren't that important) where an unclosed comment on the THEN branch of an
> IF statement would swallow up the ELSE branch completely, leaving no
> visible trace or syntactic error.
> It's worth while being careful about strings and comments.

As already mentioned up-thread, guessing without going far away could
indeed guess wrong, but it is much cheaper and the probability of an
error could be made small enough to be acceptable in cases where
"being careful" means one has to wait for many seconds for a response
for a simple editing command.  The guesswork could be activated only
when these situations arise, leaving the more accurate fontifications
do their job in all the other cases.

reply via email to

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