Skip to content

1.5. Using Directives#

Syntax#


UsingDirective = (* using_keyword: *) USING_KEYWORD
(* clause: *) UsingClause
(* for_keyword: *) FOR_KEYWORD
(* target: *) UsingTarget
(* global_keyword: *) GLOBAL_KEYWORD? (* Introduced in 0.8.13 *)
(* semicolon: *) SEMICOLON;

UsingClause = (* variant: *) IdentifierPath
| (* variant: *) UsingDeconstruction; (* Introduced in 0.8.13 *)

(* Introduced in 0.8.13 *)
UsingDeconstruction = (* open_brace: *) OPEN_BRACE
(* symbols: *) UsingDeconstructionSymbols
(* close_brace: *) CLOSE_BRACE;

(* Introduced in 0.8.13 *)
UsingDeconstructionSymbols = (* item: *) UsingDeconstructionSymbol ((* separator: *) COMMA (* item: *) UsingDeconstructionSymbol)*;

(* Introduced in 0.8.13 *)
UsingDeconstructionSymbol = (* name: *) IdentifierPath
(* alias: *) UsingAlias?; (* Introduced in 0.8.19 *)

(* Introduced in 0.8.19 *)
UsingAlias = (* as_keyword: *) AS_KEYWORD
(* operator: *) UsingOperator;

(* Introduced in 0.8.19 *)
UsingOperator = (* variant: *) AMPERSAND
| (* variant: *) ASTERISK
| (* variant: *) BANG_EQUAL
| (* variant: *) BAR
| (* variant: *) CARET
| (* variant: *) EQUAL_EQUAL
| (* variant: *) GREATER_THAN
| (* variant: *) GREATER_THAN_EQUAL
| (* variant: *) LESS_THAN
| (* variant: *) LESS_THAN_EQUAL
| (* variant: *) MINUS
| (* variant: *) PERCENT
| (* variant: *) PLUS
| (* variant: *) SLASH
| (* variant: *) TILDE;

UsingTarget = (* variant: *) TypeName
| (* variant: *) ASTERISK;

Documentation#

Note

This section is under construction. You are more than welcome to contribute suggestions to our GitHub repository.