declarator unit

Documentation for declarator unit assembled from the following types:

language documentation Syntax

From Syntax

(Syntax) declarator unit

There are several types of package, each declared with a keyword, a name, some optional traits, and a body of subroutines, methods, or rules.

package P { }
 
module M { }
 
class C { }
 
role R { }
 
grammar G { }

Several packages may be declared in a single file. However, you can declare a unit package at the start of the file (preceded only by comments or use statements), and the rest of the file will be taken as being the body of the package. In this case, the curl brackets are not required.

unit module M;
# ... stuff goes here instead of in {}'s