Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | Async (_, p, id, par) ->
- (
- let nr = !nr_ref in
- nr_ref := nr + 1;
- match Env.lookup_task id topl with
- | TaskDef (id, al, sl) ->
- let idp = path ^ "_" ^ id ^ if nr > 0 then string_of_int nr else "" in
- let sl = Str.split (Str.regexp ",") al in
- let arg a = Str.split (Str.regexp "[ \t]+") a in
- let argl = List.map arg sl in
- let arga ar = match ar with
- | a :: b :: [] -> " arg_" ^ idp ^ "." ^ b
- | _ -> failwith("Error parsing argument (" ^ al ^ ") of task " ^ id)
- in
- let args = mycon "," (List.map arga argl) in
- "ARG_" ^ id ^ " arg_" ^ idp ^ "; // instance for argument" ^ nl ^
- "void entry_" ^ idp ^ "(int RTFM_id) {" ^ nl ^
- tab ^ idp ^ pass_par args ^ "; // (inlined) call to the async function" ^ nl ^
- "}"
- | _ -> raise (RtfmError("Lookup failed in Env.lookup_task id topl"))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement