Caution

You’re reading a draft of the Ferrocene Language Specification. Some parts of this document might be missing, incomplete or incorrect. Our aim is to have the specification ready by the end of 2022.

3. Items

Syntax

Item ::=
    OuterAttributeOrDoc* (ItemWithVisibility | MacroItem)

ItemWithVisibility ::=
    VisibilityModifier? (
        ConstantDeclaration
      | EnumDeclaration
      | ExternalBlock
      | ExternalCrateImport
      | FunctionDeclaration
      | Implementation
      | ModuleDeclaration
      | StaticDeclaration
      | StructDeclaration
      | TraitDeclaration
      | TypeAliasDeclaration
      | UnionDeclaration
      | UseImport
    )

MacroItem ::=
    MacroRulesDeclaration
  | TerminatedMacroInvocation

Legality Rules

3:1 The macro expansion of a terminated macro invocation is treated as zero or more items if the terminated macro invocation appears as an item.

Dynamic Semantics

3:2 Elaboration is the process by which a declaration achieves its runtime effects.