1<!--
2  ~ Copyright (c) 2012.
3  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
4  ~ of this software and associated documentation files (the "Software"), to deal
5  ~ in the Software without restriction, including without limitation the rights
6  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  ~ copies of the Software, and to permit persons to whom the Software is
8  ~ furnished to do so, subject to the following conditions:
9  ~
10  ~ The above copyright notice and this permission notice shall be included in
11  ~ all copies or substantial portions of the Software.
12  ~
13  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  ~ THE SOFTWARE.
20  -->
21
22<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
23<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
24<head>
25	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
26	<title>SyntaxHighlighter Large File Demo</title>
27	<script type="text/javascript" src="../scripts/XRegExp.js"></script>
28	<script type="text/javascript" src="../scripts/shCore.js"></script>
29	<script type="text/javascript" src="../scripts/shBrushHaxe.js"></script>
30	<link type="text/css" rel="stylesheet" href="../styles/shCore.css"/>
31	<link type="text/css" rel="Stylesheet" href="../styles/shThemeDefault.css" />
32	<script type="text/javascript">SyntaxHighlighter.all();</script>
33</head>
34
35<body>
36
37<h1>SyntaxHighlighter Haxe Language Demo</h1>
38
39<script type="syntaxhighlighter" class="brush: haxe;"><![CDATA[
40  import one.two.Three;
41
42  @attr("test")
43  class Foo<T> extends Three
44  {
45    public function new()
46    {
47        noFoo = 12;
48    }
49
50    public static inline function doFoo(obj:{k:Int, l:Float}):Int
51    {
52        for(i in 0...10)
53        {
54            obj.k++;
55            trace(i);
56            var var1 = new Array();
57            if(var1.length > 1)
58                throw "Error";
59        }
60        // The following line should not be colored, the variable is scoped out
61        var1;
62        /* Multi line
63         * Comment test
64         */
65        return obj.k;
66    }
67    private function bar():Void
68    {
69        #if flash
70        var t1:String = "1.21";
71        #end
72        try {
73            doFoo({k:3, l:1.2});
74        }
75        catch (e : String) {
76            trace(e);
77        }
78        var t2:Float = cast(3.2);
79        var t3:haxe.Timer = new haxe.Timer();
80        var t4 = {k:Std.int(t2), l:Std.parseFloat(t1)};
81        var t5 = ~/123+.*$/i;
82        doFoo(t4);
83        untyped t1 = 4;
84        bob = new Foo<Int>
85    }
86    public var okFoo(default, never):Float;
87    var noFoo(getFoo, null):Int;
88    function getFoo():Int {
89        return noFoo;
90    }
91
92    public var three:Int;
93  }
94  enum Color
95  {
96    red;
97    green;
98    blue;
99    grey( v : Int );
100    rgb (r:Int,g:Int,b:Int);
101  }
102]]></script>
103
104</body>
105</html>
106