<beginfold id='5'>/********</beginfold id='5'>
* Highlight testing module.
*
* Do not attempt to run this!
<endfold id='5'>***********/</endfold id='5'>
module highlighttest;
import X = null;

<beginfold id='6'>/++</beginfold id='6'> Pragma directives. DDoc + DDoc embedded items. Special Tokens.
+
+ ---
+ // comment
+ #line 12 "hightlighttest.d"	<beginfold id='3'>/*</beginfold id='3'> block comment <endfold id='3'>*/</endfold id='3'>
+ #line __LINE__ __FILE__	<beginfold id='6'>/++</beginfold id='6'> embedded block comment <endfold id='6'>+/</endfold id='6'>
+
+ pragma <beginfold id='3'>/*</beginfold id='3'> <endfold id='3'>*/</endfold id='3'> (msg, "what?");
+ pragma(<beginfold id='6'>/++</beginfold id='6'> <endfold id='6'>+/</endfold id='6'> lib, "insane.a");
+ pragma(D_Custom_Extension, "custom data");
+ ---
<endfold id='6'>+/</endfold id='6'>

/// version condition
version = X;
version (X) ;
version(linux) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>

/// linkage
extern
    (C) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
extern :
;
extern (Windows) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>

/// alias & typedef
alias int.min minint;
typedef int myint;

int main(char[][] args) <beginfold id='2'>{</beginfold id='2'>
    /// statements
    if (1) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    else <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    with (N) <beginfold id='2'>{</beginfold id='2'>x = B<endfold id='2'>}</endfold id='2'>
    
    /// attributes
    auto x = 1;
    static if (true) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    void (in X, out Y) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>	// NOTE: using in like this is rare, more common to use as an expression and no way to tell apart?
    
    /// deprecated
    deprecated void fct ();
    
    /// types
    void a;
    ushort u;
    int[uint] AA;
    class C;
    enum N : int <beginfold id='2'>{</beginfold id='2'> A = 5, B <endfold id='2'>}</endfold id='2'>
    typeof(u) u2;
    
    /// expressions
    x = cast(int) 55;
    void* p = null;
    p = cast(void*) new int;
    x = 1 in AA;	// NOTE: a THIRD use of in. How to detect??
    assert (true);
        
    /// libsymbols
    string s = "";
    throw new Exception;
    TypeInfo ti = typeid(int);
    
    /// tests
    debug <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    debug (2) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    debug (DSymb) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    unittest <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    
    /// scope (as attribute and as statement)
    scope struct S;
    scope (exit) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    scope 
     (success) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>	// NOTE: rules cannot match across new-lines
    scope (failure) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    
    /// Properties
    x = int.min;
    s = (5-3).stringof;
    
    /// strings
    s = r"raw string";
    s = x"00FF";
    s = \n \a;
    s = \u1234;
    s = \U12345678;
    s = \&amp; ;
    char c = 'a';
    s = "abc 012 \" \n \x12 \u1234 \U12345678";
    s = `BQString '"`;
    
    /// region markers
    <beginfold id='1'>//BEGIN</beginfold id='1'> x
    <endfold id='1'>//END</endfold id='1'> x
    
    /// DDoc
    <beginfold id='5'>/*******</beginfold id='5'>
    * DDoc
    *
    * Section:
    * New section.
    * $(I italic)
    <endfold id='5'>*******/</endfold id='5'>
    <beginfold id='6'>/+++++++</beginfold id='6'>
    + DDoc
    + /+
    + +/
    <endfold id='6'>+++++++/</endfold id='6'>
    
    // comments
    // FIXME NOTE
    <beginfold id='3'>/*</beginfold id='3'> comment <endfold id='3'>*/</endfold id='3'>
    <beginfold id='4'>/+</beginfold id='4'> comment <beginfold id='4'>/+</beginfold id='4'> nested comment <endfold id='4'>+/</endfold id='4'> <endfold id='4'>+/</endfold id='4'>
    
    /// brace folding
    <beginfold id='2'>{</beginfold id='2'>
    <endfold id='2'>}</endfold id='2'>
    
    <beginfold id='5'>/**</beginfold id='5'> normal text
    * ---
    * .x;
    * ..
    * ...
    * ....
    * .....
    * _._
    * _e1
    * ---
    <endfold id='5'>*/</endfold id='5'>
    
    /// float and int literals
    int i;
    real r;
    ireal ir;
    r = .0;
    r = 0f;
    ir = 0e0i;
    ir = 0.fi;
    r = 0.0e0;
    r = 0xF.Fp0;
    r = 0x_._p0_;
    i = 5;
    i = -1;
    i = 0b10;
    i = 0070;
    i = 00;
    i = 0xF0;
    
    /// ranges
    int[] A;
    i = A[1];
    A = A[0..$];
    A = A[0..0];
    A = A[0..length];
    
    /// labels
    label:
    goto label;
    
    /// function, delegate
    creal function () fp = function creal() <beginfold id='2'>{</beginfold id='2'> return 0f+0fi; <endfold id='2'>}</endfold id='2'>;
    void delegate (in int i, lazy int b) dg = delegate void (int, int) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    
    /// in, out, body
    // NOTE: highlighting in & out as statements here could be difficult
    float F ()
    in <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    out (result) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    body <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
    
    /// try, catch, finally
    try <beginfold id='2'>{</beginfold id='2'>
        throw new Exception("oh no... ");
    <endfold id='2'>}</endfold id='2'> catch (Exception e) <beginfold id='2'>{</beginfold id='2'>
    <endfold id='2'>}</endfold id='2'> finally <beginfold id='2'>{</beginfold id='2'>
    <endfold id='2'>}</endfold id='2'>
    
    /// mixin
    mixin("return false;").stringof;
    
    /// templates
    macro; // what does this do?
    template Tp (T) <beginfold id='2'>{</beginfold id='2'>
        Tp t;
    <endfold id='2'>}</endfold id='2'>
    Tp!(int) y;
<endfold id='2'>}</endfold id='2'>
