Skip to content

Commit

Permalink
callback is long gone
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Mar 20, 2017
1 parent 3550e3a commit 9203fbb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/generators/gencs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,7 @@ type net_lib_ctx = {
}

let is_haxe_keyword = function
| "callback" | "cast" | "extern" | "function" | "in" | "typedef" | "using" | "var" | "untyped" | "inline" -> true
| "cast" | "extern" | "function" | "in" | "typedef" | "using" | "var" | "untyped" | "inline" -> true
| _ -> false

let hxpath_to_net ctx path =
Expand Down
2 changes: 1 addition & 1 deletion src/generators/genjava.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,7 @@ exception ConversionError of string * pos
let error s p = raise (ConversionError (s, p))

let is_haxe_keyword = function
| "callback" | "cast" | "extern" | "function" | "in" | "typedef" | "using" | "var" | "untyped" | "inline" -> true
| "cast" | "extern" | "function" | "in" | "typedef" | "using" | "var" | "untyped" | "inline" -> true
| _ -> false

let jname_to_hx name =
Expand Down
14 changes: 2 additions & 12 deletions src/typing/typer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1575,8 +1575,7 @@ and type_field ?(resume=false) ctx e i p mode =
| _ ->
try using_field ctx mode e i p with Not_found -> no_field()

let type_bind ctx (e : texpr) params p =
let args,ret = match follow e.etype with TFun(args, ret) -> args, ret | _ -> error "First parameter of callback is not a function" p in
let type_bind ctx (e : texpr) (args,ret) params p =
let vexpr v = mk (TLocal v) v.v_type p in
let acount = ref 0 in
let alloc_name n =
Expand Down Expand Up @@ -4088,21 +4087,12 @@ and type_call ctx e el (with_type:with_type) p =
mk (TCall (mk (TLocal v_trace) t_dynamic p,[e;infos])) ctx.t.tvoid p
else
type_expr ctx (ECall ((EField ((EField ((EConst (Ident "haxe"),p),"Log"),p),"trace"),p),[mk_to_string_meta e;infos]),p) NoValue
| (EConst(Ident "callback"),p1),args ->
let ecb = try Some (type_ident_raise ctx "callback" p1 MCall) with Not_found -> None in
(match ecb with
| Some ecb ->
build_call ctx ecb args with_type p
| None ->
display_error ctx "callback syntax has changed to func.bind(args)" p;
let e = type_expr ctx e Value in
type_bind ctx e args p)
| (EField ((EConst (Ident "super"),_),_),_), _ ->
def()
| (EField (e,"bind"),p), args ->
let e = type_expr ctx e Value in
(match follow e.etype with
| TFun _ -> type_bind ctx e args p
| TFun signature -> type_bind ctx e signature args p
| _ -> def ())
| (EConst (Ident "$type"),_) , [e] ->
let e = type_expr ctx e Value in
Expand Down

0 comments on commit 9203fbb

Please sign in to comment.