Source files

Xenon programs are written as UTF-8 text in files with the .xe extension.

File structure

Every source file contains exactly one file-scoped namespace declaration. using directives may appear before it. Declarations that follow belong to that namespace for the entire file.

using Xenon.Math;

namespace Example;

int Main()
{
    return 0;
}

Reserved identifiers

Identifiers beginning with __xenon_ are reserved for the compiler/runtime ABI. Declaring or referencing them, including through extern, produces error XE0010. The rule is case-sensitive and applies only at the beginning of an identifier; my__xenon_value remains an ordinary name.

Comments

Use // for a single-line comment and /* ... */ for a block comment.

// Explain one line of code.
int value = 42;

/*
   A comment may span
   several lines.
*/

Compiling several files

A .xeproj project file defines the source tree to compile together, the output type and build settings. A using directive resolves names from included sources; it does not load another file by itself. See project files (.xeproj) for a complete example with two source files and the rules for building a directory without a project file.