@@ -235,7 +235,7 @@ runscript( Dir, Refactor, [RequestFile, SumFile] ) ->
235235 {Lam , Fa , R , LibMap } = case erl_parse :parse_term ( Tokens ) of
236236 {error , Reason } -> error ( Reason );
237237 {ok , Y } -> Y
238- end ,
238+ end ,
239239
240240 % run script
241241 Summary = case check_run ( Lam , Fa , R , Dir , LibMap ) of
@@ -403,35 +403,36 @@ when is_tuple( Lam ),
403403 {lam , _Line , _LamName , Sign , Body } = Lam ,
404404 {forbody , Lang , Script } = Body ,
405405 {sign , Lo , Li } = Sign ,
406+ Mod = list_to_existing_atom (" effi_" ++ atom_to_list (Lang )),
406407
407408 % get Foreign Function Interface type
408- FfiType = apply ( Lang , ffi_type , [] ),
409+ FfiType = apply ( Mod , ffi_type , [] ),
409410
410411 % include lib paths
411- LibPath = [[apply ( Lang , libpath , [P ] ), $\n ] || P <- maps :get ( Lang , LibMap , [] )],
412+ LibPath = [[apply ( Mod , libpath , [P ] ), $\n ] || P <- maps :get ( Lang , LibMap , [] )],
412413
413414 % collect assignments
414415 Assign = lists :map (
415416 fun ( {param , {name , N , _Pf }, Pl } ) ->
416417 X = maps :get ( N , Fa ),
417418 X1 = [S ||{str , S } <- X ],
418- [apply ( Lang , assignment , [N , Pl , X1 ] ), $\n ]
419+ [apply ( Mod , assignment , [N , Pl , X1 ] ), $\n ]
419420 end ,
420421 Li ),
421422
422423 % collect dismissals
423424 Suffix = lists :map (
424425 fun ( {param , {name , N , _Pf }, Pl } ) ->
425- [apply ( Lang , dismissal , [N , Pl ] ), $\n ]
426+ [apply ( Mod , dismissal , [N , Pl ] ), $\n ]
426427 end ,
427428 Lo ),
428429
429- Script1 = apply ( Lang , preprocess , [Script ] ),
430+ Script1 = apply ( Mod , preprocess , [Script ] ),
430431
431432 Script2 = io_lib :format ( " ~s~n~s~n~s~n~s~n " , [LibPath , Assign , Script1 , Suffix ] ),
432433
433434 % run script
434- {_Port , _ActScript } = apply ( FfiType , create_port , [Lang , Script2 , Dir ] ).
435+ {_Port , _ActScript } = apply ( FfiType , create_port , [Mod , Script2 , Dir ] ).
435436
436437
437438
0 commit comments