summaryrefslogtreecommitdiff
path: root/tests/examplefiles/example.hx
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-05-17 09:19:35 -0700
committerTim Hatch <tim@timhatch.com>2014-05-17 09:19:35 -0700
commita62cdcfaa5a260274303cb93b92a3f2e2ce3be98 (patch)
treee7d2b4cd4e10a6e43fe4b2dc4e03ab2e827ebc20 /tests/examplefiles/example.hx
parent70a10a2e423d9729b62c7b56faca28889c0d688a (diff)
parentff12540907fe9d98bf02c9508a171659457b14b2 (diff)
downloadpygments-a62cdcfaa5a260274303cb93b92a3f2e2ce3be98.tar.gz
Merged in timgilbert/pygments-main/clj-keyword-fix (pull request #326)
Tweaking clojure keyword lexing
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