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 { }

You can declare a unit package without explicit curly braces. This must be 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.

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