Fix: merge conflict
[myslice.git] / third-party / codemirror-3.15 / mode / haxe / index.html
1 <!doctype html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>CodeMirror: Haxe mode</title>
6     <link rel="stylesheet" href="../../lib/codemirror.css">
7     <script src="../../lib/codemirror.js"></script>
8     <script src="haxe.js"></script>
9     <link rel="stylesheet" href="../../doc/docs.css">
10     <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11   </head>
12   <body>
13     <h1>CodeMirror: Haxe mode</h1>
14
15 <div><textarea id="code" name="code">
16 import one.two.Three;
17
18 @attr("test")
19 class Foo&lt;T&gt; extends Three
20 {
21         public function new()
22         {
23                 noFoo = 12;
24         }
25         
26         public static inline function doFoo(obj:{k:Int, l:Float}):Int
27         {
28                 for(i in 0...10)
29                 {
30                         obj.k++;
31                         trace(i);
32                         var var1 = new Array();
33                         if(var1.length > 1)
34                                 throw "Error";
35                 }
36                 // The following line should not be colored, the variable is scoped out
37                 var1;
38                 /* Multi line
39                  * Comment test
40                  */
41                 return obj.k;
42         }
43         private function bar():Void
44         {
45                 #if flash
46                 var t1:String = "1.21";
47                 #end
48                 try {
49                         doFoo({k:3, l:1.2});
50                 }
51                 catch (e : String) {
52                         trace(e);
53                 }
54                 var t2:Float = cast(3.2);
55                 var t3:haxe.Timer = new haxe.Timer();
56                 var t4 = {k:Std.int(t2), l:Std.parseFloat(t1)};
57                 var t5 = ~/123+.*$/i;
58                 doFoo(t4);
59                 untyped t1 = 4;
60                 bob = new Foo&lt;Int&gt;
61         }
62         public var okFoo(default, never):Float;
63         var noFoo(getFoo, null):Int;
64         function getFoo():Int {
65                 return noFoo;
66         }
67         
68         public var three:Int;
69 }
70 enum Color
71 {
72         red;
73         green;
74         blue;
75         grey( v : Int );
76         rgb (r:Int,g:Int,b:Int);
77 }
78 </textarea></div>
79
80     <script>
81       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
82         lineNumbers: true,
83         indentUnit: 4,
84         indentWithTabs: true
85       });
86     </script>
87
88     <p><strong>MIME types defined:</strong> <code>text/x-haxe</code>.</p>
89   </body>
90 </html>