bugGNU Octave - Bugs: bug #35535, Index-expression parsing issue

 
 

bug #35535: Index-expression parsing issue

Submitter:  Vladimir <enargit>
Submitted:  Wed 15 Feb 2012 01:44:55 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.4.3 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 16 Mar 2014 07:38:10 PM UTC, comment #2: 

No response to request for info.  Closing report.

Rik <rik5>
Group administrator
Sat 11 Jan 2014 09:31:18 PM UTC, comment #1: 

There have been many changes to Octave's parser since version 3.4.3. Can you test whether this bug is still present in the current 3.8.0 release of Octave? Or can you provide a minimal code example that shows the bug on your system?

Mike Miller <mtmiller>
Group Member
Wed 15 Feb 2012 01:44:55 PM UTC, original submission:  

Hello!

I am working on Octclipse project (Eclipse-based GUI for Octave). Now my goal is to reuse octave parser. The idea is to have native C++ code to XML and then use those XML in Java.

My code is based on Octave's tree_print_code class (pt-pr-code.h / pt-pr-code.cc) and is very similar. But I encountered a bug in  tree_print_code.

Consider the following code:


x(1).a = "string1";
x(2).a = "string2";
x(1).q = 1;
x(2).q = 2;
q='a';
x.q
x.(q)


It runs in octave as expected. However, when I try to process it with tree_print_code, I get the following output:


x (1).a = "string1";
x (2).a = "string2";
x (1).q = 1;
x (2).q = 2;
q = 'a';
x.q
x.


So, argument for dot operation (last line) is lost.

My testing code looks like


  std::string fname = octave_canonicalize_file_name (file_ops::tilde_expand (
      args (0).string_value ()));
  tree_print_code print_code (std::cout);

  octave_function *fcn = load_fcn_from_file (fname, "", "", "", true);
  if (fcn)
  {
    fcn->accept (print_code);
  }


I tried to debug this on myself, but did not manage to find lost argument "(q)" in parsed octave_function object at all.

Could you fix this issue or suggest a workaround?

Vladimir <enargit>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by enargit (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-16 rik5 Open/ClosedOpen Closed
    2014-01-11 mtmiller CategoryNone Interpreter
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code