Module compilation unit grammar

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Apr 1 13:33:23 PDT 2011


On 03/18/2011 11:33 AM, Alex Buckley wrote:
> On 3/18/2011 9:23 AM, Alan Bateman wrote:
>>> ModuleRequire:
>>>   'require' [ModuleRequireModifier] ModuleName ['@' VersionQuery] ';'
>> Just going through your mail of 3/11. Should this be "requires" as I 
>> think that is what javac looks for today? Same this with 
>> ModuleProvide where I think it may be "provides".
>
> As the scope of the module system expands to include features like 
> explicit exports of packages/classes, it becomes clear that the 
> "directives" in the module compilation unit are really _statements_ of 
> a Java-like language to configure observability (JLS 7.4.3).
>
> Syntax is as usual a matter of taste but we can look to statements in 
> the Java language for guidance. We find 'import' not 'imports', and 
> 'assert' not 'asserts'. So I now propose 'export' not 'exports', and 
> 'require' not 'requires', etc.
>
> Alex

The "-s" forms of the words seem more natural, and we can look to 
"throws" for guidance.       Looking to imperative statements for 
guidance seems, well, misguided.

-- Jon



More information about the jigsaw-dev mailing list