octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #60712] Editor : highlight statements that are


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #60712] Editor : highlight statements that are not terminated by semicolon
Date: Thu, 3 Jun 2021 10:42:30 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #7, bug #60712 (project octave):


This regexpr has a lot of false finds, such as statements broken on multiple
lines, if and switch statements with their else and case clauses, functions
and endfunctions, classdefs and properties, ... and so on ! 


Maybe this job could be done semi-reliably with some ad-hoc parsing built
directly into the editor, I don't know.  But that approach seems like a lot of
work and probably unreliable.

My guess is that unless it is hooked into Octave's parser, the editor will
have the same problem identifying expressions that are not terminated with
semicolons.

If it is hooked into Octave's parser, then how often will the parser have to
run?  Does it have to parse the entire text from the beginning of the file
each time a character is added to the file?  If there are any syntax errors in
the file, the results could be wildly wrong until all the syntax errors are
corrected.

As a related issue, Octave's parser currently just fails at the first error. 
It doesn't perform error recovery and attempt to find a new good point to
resume parsing.  That could probably be fixed, but is no small task.

I'm not disagreeing that this feature would be nice to have, but it seems to
me that implementing it well represents a significant amount of work.

We are all volunteers here.  If you are interested in this feature, can you
help to implement it?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60712>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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