Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Code Block
syntax Using
  | UsingOpen  = "using" NamespaceOrType ";";
  | UsingAlias = "using" Name "=" NamespaceOrType ";";

Nitra Using directives are very similar to the ones used in C#. Their purpose is to shorten names.
UsingOpen lets you open up a Namespace, a SyntaxModule and a type, after which the opened character can be addressed with a short name. For example:

Code Block
using Nitra;
NSpan(1, 2)

UsingAlias you to create an alias for a type or SyntaxModule. For example:

Code Block
using Token = Nitra.NSpan;
Token(1, 2)