$include - brombres/Rogue GitHub Wiki

Syntax

$include <Filepath> [api folder optional]
$includeFolder <Path> [api optional]
Syntax Description
$include "Path/Filename.rogue" Includes Path/Filename.rogue.
$include Path/Filename.rogue Can omit quotes if filepath contains only common alphanumeric characters and ~/:\.
$include Path/Filename Can omit .rogue.
$include LibraryName Includes LibraryName/LibraryName.rogue or LibraryName.rogue, whichever is found first.
$include Path [folder] Recursively includes all .rogue files in the specified folder.
$includeFolder Path Alternate syntax for $include Path [folder].
$include Filepath [optional] No error generated if filepath does not exist.
$include Filepath [api] All elements of included file are designated [api], preventing unused classes and methods from being culled during compilation and making them available to introspection.
$include Filepath [target("ObjC")] Only includes the file if the named --target was specified during compilation.

Description

  • Immediately parses the specified source file.
  • For a given source file, only the first $include has an effect - subsequent includes of the same file are ignored.
  • The order of includes typically doesn't matter - classes, routines, and most program elements can be referenced before their definitions are $included.
  • $define and $macro definitions must be $included before they are referenced in source code - for example, by defining them in Definitions.rogue and making $include Definitions be the first $include in a program.
  • The path of every included file is automatically added to the search path for future includes.

See Also

⚠️ **GitHub.com Fallback** ⚠️