Renamed Exprs.map to Exprs.typedMap to not collide with haxe.macro.ExprTools
This commit is contained in:
@@ -229,11 +229,11 @@ class Exprs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function map(source:Expr, f:Expr->Array<VarDecl>->Expr, ctx:Array<VarDecl>, ?pos:Position):Expr {
|
static public function typedMap(source:Expr, f:Expr->Array<VarDecl>->Expr, ctx:Array<VarDecl>, ?pos:Position):Expr {
|
||||||
if (ctx == null) ctx = [];
|
if (ctx == null) ctx = [];
|
||||||
|
|
||||||
function rec(e, ?inner)
|
function rec(e, ?inner)
|
||||||
return map(e, f, inner == null ? ctx : inner, pos);
|
return typedMap(e, f, inner == null ? ctx : inner, pos);
|
||||||
if (source == null || source.expr == null) return source;
|
if (source == null || source.expr == null) return source;
|
||||||
var mappedSource = f(source, ctx);
|
var mappedSource = f(source, ctx);
|
||||||
if (mappedSource != source) return mappedSource;
|
if (mappedSource != source) return mappedSource;
|
||||||
@@ -354,7 +354,7 @@ class Exprs {
|
|||||||
var ret = [];
|
var ret = [];
|
||||||
for (v in vars)
|
for (v in vars)
|
||||||
{
|
{
|
||||||
var vExpr = v.expr == null ? null : map(v.expr, f, ctx);
|
var vExpr = v.expr == null ? null : typedMap(v.expr, f, ctx);
|
||||||
if (v.type == null && vExpr != null)
|
if (v.type == null && vExpr != null)
|
||||||
v.type = vExpr.typeof(ctx).sure().toComplex();
|
v.type = vExpr.typeof(ctx).sure().toComplex();
|
||||||
ctx.push({ name:v.name, expr:null, type:v.type });
|
ctx.push({ name:v.name, expr:null, type:v.type });
|
||||||
@@ -370,7 +370,7 @@ class Exprs {
|
|||||||
static public function typedMapArray(source:Array<Expr>, f:Expr->Array<VarDecl>->Expr, ctx:Array<VarDecl>, ?pos) {
|
static public function typedMapArray(source:Array<Expr>, f:Expr->Array<VarDecl>->Expr, ctx:Array<VarDecl>, ?pos) {
|
||||||
var ret = [];
|
var ret = [];
|
||||||
for (e in source)
|
for (e in source)
|
||||||
ret.push(map(e, f, ctx, pos));
|
ret.push(typedMap(e, f, ctx, pos));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user