]> git.ipfire.org Git - thirdparty/gcc.git/commit
a68: support for publicized modules
authorJose E. Marchesi <jose.marchesi@oracle.com>
Sat, 27 Dec 2025 20:09:20 +0000 (21:09 +0100)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Sat, 27 Dec 2025 23:54:36 +0000 (00:54 +0100)
commitf3d9820d2b50668b1a9515e748e462a02bf09621
treedada0b38adfc4c7ed6a500568bc650ab00e14f79
parentf129bfb6a81abd8dcf8ccc6e4b23813766d9fdb2
a68: support for publicized modules

This commit adds support for modules publicizing the exports of other
modules.  For example:

  module GRAMP =
      access pub GRAMP_Symbol,
             pub GRAMP_Word,
             pub GRAMP_Alphabet
  def pub string libgramp_version = "1.0";
      skip
  fed

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-parser-taxes.cc (tax_module_dec): Do not handle
DEFINING_MODULE_INDICANT.
* a68-exports.cc (a68_add_module_to_moif): Do not mangle module
names in module extracts.
(add_pub_revelations_to_moif): New function.
(a68_do_exports): Simplify and call add_pub_revelations_to_moif.
* a68-imports.cc (a68_decode_moifs): Add all decoded moifs to the
global list TOP_MOIF.
* a68-parser-extract.cc (extract_revelation): Recurse to import
extracts from publicized modules.
(a68_extract_indicants): Do not add symbol table entries for
defining modules.
* a68-types.h (struct TAG_T): Remove field EXPORTED.
(EXPORTED): Remove macro.
(TOP_MOIF): Define.
* a68-parser.cc (a68_parser): Initialize global list of moifs.
(a68_new_tag): Do not initialize EXPORTED.

gcc/testsuite/ChangeLog

* algol68/execute/modules/module22bar.a68: New test.
* algol68/execute/modules/module22foo.a68: Likewise.
* algol68/execute/modules/program-22.a68: Likewise.
* algol68/compile/modules/program-11.a68: Adjust test to
publicized modules.
* algol68/compile/modules/program-error-multiple-delaration-module-1.a68:
Likewise.
gcc/algol68/a68-exports.cc
gcc/algol68/a68-imports.cc
gcc/algol68/a68-parser-extract.cc
gcc/algol68/a68-parser-taxes.cc
gcc/algol68/a68-parser.cc
gcc/algol68/a68-types.h
gcc/testsuite/algol68/compile/modules/program-11.a68
gcc/testsuite/algol68/compile/modules/program-error-multiple-delaration-module-1.a68
gcc/testsuite/algol68/execute/modules/module22bar.a68 [new file with mode: 0644]
gcc/testsuite/algol68/execute/modules/module22foo.a68 [new file with mode: 0644]
gcc/testsuite/algol68/execute/modules/program-22.a68 [new file with mode: 0644]