Skip to content

Commit

Permalink
Allow hidden re-imports to coexist with declarations of identifiers o…
Browse files Browse the repository at this point in the history
…r module aliases with the same name
  • Loading branch information
andreaspirklbauer committed Jun 11, 2021
1 parent 3107792 commit 5efd80e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
Binary file modified Documentation/S3RISCinstall.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions EOS_news.txt
Expand Up @@ -36,3 +36,4 @@
2020-12-31 Modules, ORS, ORG, ORP, ORL, ORX, ORTool, Oberon0 - Add module finalization as a language construct (symbol FINAL)
2021-01-24 ORTool - Decode FLR, FLT, RTI, STI, CLI instructions
2021-04-12 In, Out - In added, Out updated
2021-06-11 ORB - Allow hidden re-imports to coexist with declarations of identifiers or module aliases with the same name
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -14,9 +14,9 @@ Features
* Import any number of modules
* Simple batch execution facility

**Last release:** 19.5.2021
**Last release:** 11.6.2021

**Last update:** 19.5.2021
**Last update:** 11.6.2021

The file [**S3RISCinstall.tar.gz**](Documentation/S3RISCinstall.tar.gz) always reflects the *latest* version of Extended Oberon, as described in the file [**EOS_news.txt**](EOS_news.txt).

Expand Down
17 changes: 9 additions & 8 deletions Sources/ORB.Mod
Expand Up @@ -72,7 +72,7 @@ MODULE ORB; (*NW 25.6.2014 / AP 4.3.2020 / 5.3.2019 in Oberon-07 / AP 13.5.2
PROCEDURE NewObj*(VAR obj: Object; id: ORS.Ident; class: INTEGER); (*insert new Object with name id*)
VAR new, x: Object;
BEGIN x := topScope;
WHILE (x.next # NIL) & (x.next.name # id) DO x := x.next END ;
WHILE (x.next # NIL) & ((x.next.name # id) OR (x.next.class = Mod) & ~x.next.rdo) DO x := x.next END ;
IF x.next = NIL THEN
NEW(new); new.name := id; new.class := class; new.next := NIL; new.rdo := FALSE; new.dsc := NIL;
x.next := new; obj := new
Expand All @@ -84,7 +84,7 @@ MODULE ORB; (*NW 25.6.2014 / AP 4.3.2020 / 5.3.2019 in Oberon-07 / AP 13.5.2
VAR s, x: Object;
BEGIN s := topScope;
REPEAT x := s.next;
WHILE (x # NIL) & (x.name # ORS.id) DO x := x.next END ;
WHILE (x # NIL) & ((x.name # ORS.id) OR (x.class = Mod) & ~x.rdo) DO x := x.next END ;
s := s.dsc
UNTIL (x # NIL) OR (s = NIL);
RETURN x
Expand Down Expand Up @@ -184,18 +184,19 @@ MODULE ORB; (*NW 25.6.2014 / AP 4.3.2020 / 5.3.2019 in Oberon-07 / AP 13.5.2
VAR mod: Module; obj, obj1: Object;
BEGIN obj1 := topScope; obj := obj1.next; (*search for module*)
WHILE (obj # NIL) & (obj(Module).orgname # orgname) DO obj1 := obj; obj := obj1.next END ;
IF obj = NIL THEN (*new module, search for alias*)
obj := topScope.next;
WHILE (obj # NIL) & (obj.name # name) DO obj := obj.next END ;
IF obj = NIL THEN (*new module*)
IF decl THEN obj := topScope.next; (*search for alias*)
WHILE (obj # NIL) & ((obj.name # name) OR ~obj.rdo) DO obj := obj.next END ;
IF obj # NIL THEN ORS.Mark("mult def") END
END ;
IF obj = NIL THEN (*insert new module*)
NEW(mod); mod.class := Mod; mod.rdo := FALSE;
mod.name := name; mod.orgname := orgname; mod.val := key;
mod.lev := nofmod; INC(nofmod); mod.type := noType; mod.dsc := NIL; mod.next := NIL;
obj1.next := mod; obj := mod
ELSIF decl THEN (*module already present, explicit import by declaration*)
IF obj.rdo THEN ORS.Mark("mult def") ELSE ORS.Mark("conflict with re-import") END
ELSE ORS.Mark("conflict with alias")
END
ELSIF decl THEN (*module already present, explicit import by declaration*)
IF obj.rdo THEN ORS.Mark("mult def") ELSE ORS.Mark("invalid import order") END
END ;
RETURN obj
END ThisModule;
Expand Down
4 changes: 2 additions & 2 deletions Sources/System.Mod
@@ -1,8 +1,8 @@
MODULE System; (*JG 3.10.90 / NW 12.10.93 / NW 20.6.2016 / AP 19.5.21 Extended Oberon*)
MODULE System; (*JG 3.10.90 / NW 12.10.93 / NW 20.6.2016 / AP 11.6.21 Extended Oberon*)
IMPORT SYSTEM, Kernel, Disk, FileDir, Files, Modules,
Input, Display, Viewers, Fonts, Texts, Oberon, MenuViewers, TextFrames;

CONST Version* = "Extended Oberon System AP 19.5.21";
CONST Version* = "Extended Oberon System AP 11.6.21";
StandardMenu = "System.Close System.Copy System.Grow Edit.Search Edit.Store | System.Expand System.Spread System.Clone";
LogMenu = "Edit.Locate Edit.Search System.Copy System.Grow System.Clear | System.Expand System.Spread System.Clone";
SystemLog = "System.Log"; SystemTool = "System.Tool"; SystemBatch = "System.Batch";
Expand Down

0 comments on commit 5efd80e

Please sign in to comment.