basex
basex copied to clipboard
Organize static functions by declaring module
Private functions declared in a library module are no longer required to be in the module namespace (see 5.18 Function Declarations). The corresponding check can be adapted easily, but the management of static functions in the StaticFuncs class currently mixes functions from all modules without taking into account where they were declared. As a result, it is not possible to use the same private function name in multiple modules.
This PR
- groups static functions by declaring module to avoid name clashes
- checks the declaring module to prevent main-module functions from becoming visible in imported modules
- allows private functions of a module to be visible in all files comprising that module (as public functions already are)
Tests for this have been added in ModuleTest.functionVisibility.