summaryrefslogtreecommitdiff
path: root/tests/examplefiles/example.hx
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-05-16 17:49:49 -0700
committerTim Hatch <tim@timhatch.com>2014-05-16 17:49:49 -0700
commit97422c5ed7200eeb588cf07f3e63cd1a80016f15 (patch)
treed34ff1aea3c8641eea785f0cb430bfa4a2630fdd /tests/examplefiles/example.hx
parentc5af6ba52c15caee0bce29fba439c8495feea1a7 (diff)
parent234df186957e0b4419d4a587daaea97dee27d484 (diff)
downloadpygments-97422c5ed7200eeb588cf07f3e63cd1a80016f15.tar.gz
Merged in dietmarw/pygments-main (pull request #348)
Modelica-lexer: Add "end" to keyword list again
Diffstat (limited to 'tests/examplefiles/example.hx')
-rw-r--r--tests/examplefiles/example.hx45
1 files changed, 44 insertions, 1 deletions
diff --git a/tests/examplefiles/example.hx b/tests/examplefiles/example.hx
index fd93bb49..381cf825 100644
--- a/tests/examplefiles/example.hx
+++ b/tests/examplefiles/example.hx
@@ -139,4 +139,47 @@ typedef Pt2 = {
y:Float,
?z:Float, //optional z
add : Point -> Void,
-} \ No newline at end of file
+}
+
+
+//top-level class members
+public function test();
+private var attr(get, set) = 1;
+
+
+//pre-proc number
+public static inline function indexOf<T>(arr:Array<T>, v:T) : Int
+{
+ #if (haxe_ver >= 3.1)
+ return arr.indexOf(v);
+ #else
+ #if (flash || js)
+ return untyped arr.indexOf(v);
+ #else
+ return std.Lambda.indexOf(arr, v);
+ #end
+ #end
+}
+
+//macro reification
+var e = macro var $myVar = 0;
+var e = macro ${v}.toLowerCase();
+var e = macro o.$myField;
+var e = macro { $myField : 0 };
+var e = macro $i{varName}++;
+var e = macro $v{myStr};
+var args = [macro "sub", macro 3];
+var e = macro "Hello".toLowerCase($a{args});
+(macro $i{tmp}.addAtom($v{name}, $atom)).finalize(op.pos);
+
+var c = macro class MyClass {
+ public function new() { }
+ public function $funcName() {
+ trace($v{funcName} + " was called");
+ }
+}
+
+var c = macro interface IClass {};
+
+//ECheckType
+var f = (123:Float); \ No newline at end of file