diff --git a/hscript/Expr.hx b/hscript/Expr.hx index c033a31..47090bf 100644 --- a/hscript/Expr.hx +++ b/hscript/Expr.hx @@ -89,7 +89,7 @@ enum Expr EMeta( name : String, args : Array, e : Expr ); ECheckType( e : Expr, t : CType ); - EImport( c : String, ?asname:String ); + EImport( c : String, ?as:String, ?f:String ); EClass( name:String, fields:Array, ?extend:String, interfaces:Array ); } diff --git a/hscript/Parser.hx b/hscript/Parser.hx index 281d4c7..91257fe 100644 --- a/hscript/Parser.hx +++ b/hscript/Parser.hx @@ -172,7 +172,7 @@ class Parser { #end } - public inline function error( err: Error, pmin: Int, pmax: Int ) { + public inline function error( err: #if hscriptPos Error.ErrorDef #else Error #end, pmin: Int, pmax: Int ) { if( !resumeErrors ) #if hscriptPos throw new Error(err, pmin, pmax, origin, line); @@ -1069,7 +1069,7 @@ class Parser { } case TId(id): var path = [id]; - var asname:String = null; + var as:String = null; var t = null; while( true ) { t = token(); @@ -1078,7 +1078,7 @@ class Parser { t = token(); switch( t ) { case TId(id): - asname = id; + as = id; default: unexpected(t); } @@ -1099,7 +1099,7 @@ class Parser { ensure(TSemicolon); push(TSemicolon); var p = path.join("."); - mk(EImport(p, asname),p1); + mk(EImport(p, as),p1); default: unexpected(tk); null; diff --git a/hscript/Tools.hx b/hscript/Tools.hx index bf08360..751ebe8 100644 --- a/hscript/Tools.hx +++ b/hscript/Tools.hx @@ -93,7 +93,7 @@ class Tools { case ESwitch(e, cases, def): ESwitch(f(e), [for( c in cases ) new SwitchCase([for( v in c.values ) f(v)], f(c.expr))], def == null ? null : f(def)); case EMeta(name, args, e): EMeta(name, args == null ? null : [for( a in args ) f(a)], f(e)); case ECheckType(e,t): ECheckType(f(e), t); - case EImport(c, as): EImport(c, as); + case EImport(c, as, f): EImport(c, as, f); case EClass(name, el, extend, interfaces): EClass(name, [for( e in el ) f(e)], extend, interfaces); } return mk(edef, e);