Opened 5 years ago

Closed 2 days ago

#5644 closed defect (fixed)

OMEdit (nearly) deletes comments

Reported by: ceraolo Owned by: adrpo
Priority: normal Milestone: 2.0.0
Component: Parser Version:
Keywords: Cc: sjoelund.se

Description (last modified by ceraolo)

Consider the enclosed TestCInterface.mo.
to the following:
1) open "Extfun"
2) open the annotation
3) before end add:

// some text

4) click on save.

=> the text

// some text

disappears.

5) open TestCInterface

=> indeed text

// some text

has been moved outside "ExtFun"

Attachments (3)

TestCInterface.mo (1.1 KB) - added by ceraolo 5 years ago.
P.mo (130 bytes) - added by adeas31 4 years ago.
script.mos (71 bytes) - added by adeas31 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by ceraolo

comment:1 Changed 5 years ago by ceraolo

  • Summary changed from OMEdit (nearly) deletes a comment to OMEdit (nearly) deletes comments

comment:2 Changed 5 years ago by ceraolo

  • Description modified (diff)

comment:3 Changed 5 years ago by ceraolo

  • Description modified (diff)

Changed 4 years ago by adeas31

Changed 4 years ago by adeas31

comment:4 Changed 4 years ago by adeas31

  • Cc sjoelund.se added
  • Component changed from OMEdit to Parser
  • Owner changed from adeas31 to adrpo
  • Status changed from new to assigned

I made a simplified example. Use the file P.mo and run the script script.mos. It will output the contents as,

package P
  model M
    Real x;
    Real y;

    external \"C\" ;
  end M;

  // some texting
  // some text
end P;

instead of

package P
  model M
    Real x;
    Real y;
    
    external "C";
    // some texting
  end M;

  // some text
end P;

Seems like something off with the parser.

comment:5 Changed 4 years ago by sjoelund.se

That's because comments are put where elements can be put. No element can come after external, so the comment is added after it. The Absyn structure cannot represent this case.

comment:6 Changed 2 days ago by ceraolo

  • Resolution set to fixed
  • Status changed from assigned to closed

This issue must have been solved some time ago

Note: See TracTickets for help on using tickets.