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

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

[Octave-bug-tracker] [bug #45967] More consistent error message style fo


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #45967] More consistent error message style for parse errors
Date: Thu, 18 Jan 2024 00:17:11 -0500 (EST)

Follow-up Comment #8, bug#45967 (group octave):

Is function being parsed because it was called from the command line?  In that
case, there is no execution stack other than the top-level workspace and that
is normally omitted from the stack trace for errors anyway.

If you had a set of functions like


function foo ()
  bar ();
endfunction
function bar ()
  baz ();
endfunction
function baz ()
  x + y */+ 2 parse error here
end


Then I guess it would make sense to issue an error message that looked
something like


error: syntax error near line 3 column 1 of /path/to/baz.m
error: called from
    bar.m at line 2 column 2
    foo.m at line 2 column 2


But I don't know why that is useful.  Evaluation and parse errors are
different things.  Just having the file name, line number, and possibly the
text of the line where the error occurs seems sufficient to me for diagnosing
parse errors.  Where the to-be-parsed function is called from seems irrelevant
to me.  I understand how a stack trace can help with understanding an
evaluation error, but how would that info help with understanding a parse
error?





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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