Haxe mode

x
 
1
import one.two.Three;
2
3
@attr("test")
4
class Foo<T> extends Three
5
{
6
    public function new()
7
    {
8
        noFoo = 12;
9
    }
10
    
11
    public static inline function doFoo(obj:{k:Int, l:Float}):Int
12
    {
13
        for(i in 0...10)
14
        {
15
            obj.k++;
16
            trace(i);
17
            var var1 = new Array();
18
            if(var1.length > 1)
19
                throw "Error";
20
        }
21
        // The following line should not be colored, the variable is scoped out
22
        var1;
23
        /* Multi line
24
         * Comment test
25
         */
26
        return obj.k;
27
    }
28
    private function bar():Void
29
    {
30
        #if flash
31
        var t1:String = "1.21";
32
        #end
33
        try {
34
            doFoo({k:3, l:1.2});
35
        }
36
        catch (e : String) {
37
            trace(e);
38
        }
39
        var t2:Float = cast(3.2);
40
        var t3:haxe.Timer = new haxe.Timer();
41
        var t4 = {k:Std.int(t2), l:Std.parseFloat(t1)};
42
        var t5 = ~/123+.*$/i;
43
        doFoo(t4);
44
        untyped t1 = 4;
45
        bob = new Foo<Int>
46
    }
47
    public var okFoo(default, never):Float;
48
    var noFoo(getFoo, null):Int;
49
    function getFoo():Int {
50
        return noFoo;
51
    }
52
    
53
    public var three:Int;
54
}
55
enum Color
56
{
57
    red;
58
    green;
59
    blue;
60
    grey( v : Int );
61
    rgb (r:Int,g:Int,b:Int);
62
}
63

Hxml mode:

8
 
1
-cp test
2
-js path/to/file.js
3
#-remap nme:flash
4
--next
5
-D source-map-content
6
-cmd 'test'
7
-lib lime
8

MIME types defined: text/x-haxe, text/x-hxml.