octave-maintainers
[Top][All Lists]
Advanced

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

Changes to lexer invalidate documentation


From: John W. Eaton
Subject: Changes to lexer invalidate documentation
Date: Sun, 12 Apr 2009 18:01:36 -0500

On 12-Apr-2009, Rik wrote:

| The parser has changed and the new output is:
| ---------------------
| functon y = f (x) y = x^2; endfunction
| parse error:
| 
|   syntax error
| 
| >>> functon y = f (x) y = x^2; endfunction

This is valid through the ";", so I think the parser is doing the best
it can.  For example, try this:

  functon y = f (x) y = x^2;

and you'll see

  error: `functon' undefined near line 1 column 1

So the syntax of this much is valid and the problem is that there is
no function called "functon" available to call.  Then there is a
syntax error when the parser sees "endfunction" as an expression by
itself.

| I would argue that this is less desirable than the old behavior.

I think we're comparing different things.  With an older version of
Octave, try

  mark_as_command functon
  functon y = f (x) y = x^2;

and you should see a message similar to what the current Octave
produces.
  
| indicating the error at the end of line it gives no clue where the real
| problem lies.

Octave doesn't try to guess that the functio name is misspelled, so
unless we decide to implement something like that (I'd rather not)
then I think it is the best we can do.

| I used hg bisect to track down the changeset which
| introduced the new behavior (changset 5dd06f19e9be).

Thanks, that helped me understand quickly why we see the new
behavior.

| If the new
| behavior can't be corrected it might be better to find a new error
| example which shows off the parser in a better light.

Yes, I agree that the behavior of this example is too complex for an
introduction to error messages.  It would be better to have something
simpler.

Thanks,

jwe


reply via email to

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