bugGNU Octave - Bugs: bug #44934, classdef parser prints extra...

 
 

bug #44934: classdef parser prints extra newline when failing to parse bad classdef file

Submitted by:  Rik <rik5>
Submitted on:  Mon 27 Apr 2015 05:19:46 AM UTC  
 
Category:  Interpreter Severity:  2 - Minor
Priority:  1 - Later Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 27 Apr 2015 04:56:45 PM UTC, comment #3:

The actual error when trying to instantiate an object from class DocSimpleDouble is

If I change the first line of DocSimpleDouble to

Then I get the nearly the same message, but there is no newline between the entering of the command and the line which begins with "error:". This also works with tst_try.

So maybe the problem is something in the classdef parser rather than try/catch. Re-titling again.

Rik <rik5>
Project Administrator
Mon 27 Apr 2015 04:48:59 PM UTC, comment #2:

Further debugging shows that it is only a problem when the parser is trying to deal with an empty class name to inherit from.

Currently, the first line of DocSimpleDouble is

where I have explicitly shown the newline (it isn't shown in the editor). With this configuration there is an extra newline printed from tst_try.m.

If I change the first line to

then there is no extra newline printed.

Rik <rik5>
Project Administrator
Mon 27 Apr 2015 04:23:14 PM UTC, comment #1:

I checked in a cset that stops Octave from searching for additional help text after an error is encountered (http://hg.savannah.gnu.org/hgweb/octave/rev/4ff975c58584). This fixes the immediate problem reported in this bug, but I still get an extra newline (down to only 1) when running tst_try.m. Re-titling the report to reflect that.

Rik <rik5>
Project Administrator
Mon 27 Apr 2015 05:19:46 AM UTC, original submission:

This is a bit involved, but there appears to be an error in the way get_help_text and parsing of classdef files with errors are done.

The set-up is to have DocSimpleDouble.m in the current directory ("."). Also in the current directory is the script tst_try.m. Run tst_try and you will get two newlines ahead of the final retval for the function. See below

When I run tst_try under 3.8.2 there are no extra newlines.

The newlines aren't such a big deal, but they seem to be indicative of a bigger problem.

If I run the failing line of tst_try in the dev version of Octave I get

What is odd is that there are two errors produced. It is as if the error_status variable is getting set, but no one is checking it and get_help_text in corefcn/help.cc is continuing. 3.8.2 does the same thing, i.e., it produces two error messages. But it doesn't produce two newlines in tst_try.m

Rik <rik5>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #33815:  DocSimpleDouble.m added by rik5 (231B - text/x-objcsrc)
file #33816:  tst_try.m added by rik5 (142B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-14 rik5 Priority5 - Normal => 1 - Later
    2015-05-01 rik5 Severity3 - Normal => 2 - Minor
    2015-04-27 rik5 Summarytry/catch prints extra newline when parsing bad classdef file => classdef parser prints extra newline when failing to parse bad classdef file
    2015-04-27 rik5 Summarytry/catch prints extra newline => try/catch prints extra newline when parsing bad classdef file
    2015-04-27 rik5 Summaryget_help_text issues two error messages when failing to parse classdef file => try/catch prints extra newline
    2015-04-27 rik5 Attached File- => Added DocSimpleDouble.m, #33815
        Attached File- => Added tst_try.m, #33816

    Back to the top


    Powered by Savane 3.3