Opened 13 years ago

Closed 12 years ago

#1727 closed defect (invalid)

Loading structured package

Reported by: Hubert Thieriot Owned by: Hubert Thieriot
Priority: high Milestone: 1.9.0
Component: Parser Version:
Keywords: Cc: Hubert Thieriot

Description

When I am loading a directory structured package, if one of child package.mo can not be loaded (e.g. due to an encoding error), then no one else is loaded and root package has no child.

More detailed description

A/package.mo
A/B/package.mo (with an encoding error while loading alone)
A/C/package.mo (working properly)

When loading A/B/package.mo alone, an error is displayed which is correct behaviour.
When loading A/package.mo, no error is displayed but no package under A.
When removing A/B folder, and loading A/package.mo, loading is made properly. A got C child.

Any idea ?

Hubert

Change History (2)

comment:1 by Martin Sjölund, 13 years ago

I get the intended behaviour: If any file failed to load, false is return and no class at all is loaded.

loadFile("package.mo");
getErrorString();
list();

loadFile("A/package.mo");
getErrorString();
list();

loadFile("B/package.mo");
getErrorString();
list();
$ omc a.mos
/home/marsj/dev/trunk/build/bin/omc 1.8.1+ (r11582)
false
"[/home/marsj/tmp/P/../P/B/package.mo:3:25-3:28:writable] Error: The file was not encoded in UTF-8:
  "???".
  To change encoding when loading a file: loadFile(encoding="ISO-XXXX-YY").
  To change it in a package: add a file package.encoding at the top-level.
"
""
false
"Error: Failed to insert class A within P;
 the available classes were:
"
""
false
"[B/package.mo:3:25-3:28:writable] Error: The file was not encoded in UTF-8:
  "???".
  To change encoding when loading a file: loadFile(encoding="ISO-XXXX-YY").
  To change it in a package: add a file package.encoding at the top-level.
"
""

comment:2 by Martin Sjölund, 12 years ago

Cc: hubert.thieriot, → hubert.thieriot
Component: Parser
Milestone: 1.9.0
Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.