|
@@ -35,6 +35,22 @@ using Lambda;
|
|
**/
|
|
**/
|
|
class ExprTools {
|
|
class ExprTools {
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ Returns the `Position` where the caller of `makeMacroPosition` is.
|
|
|
|
+ **/
|
|
|
|
+ macro static function makeMacroPosition():ExprOf<Position>
|
|
|
|
+ {
|
|
|
|
+ var positionExpr = Context.makeExpr(Context.getPosInfos(Context.currentPos()), Context.currentPos());
|
|
|
|
+ if (Context.defined("macro"))
|
|
|
|
+ {
|
|
|
|
+ return macro Context.makePosition($positionExpr);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return positionExpr;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
Converts expression [e] to a human-readable String representation.
|
|
Converts expression [e] to a human-readable String representation.
|
|
|
|
|
|
@@ -303,4 +319,4 @@ class ExprArrayTools {
|
|
for (e in el)
|
|
for (e in el)
|
|
f(e);
|
|
f(e);
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|