Skip to content
Snippets Groups Projects
Commit 9a0dbd72 authored by sof's avatar sof
Browse files

[project @ 1998-11-13 19:34:33 by sof]

Allow 'foreign import' calling conv. to be optional
parent bee867fe
No related merge requests found
...@@ -555,6 +555,8 @@ callconv: STDCALL { $$ = CALLCONV_STDCALL; } ...@@ -555,6 +555,8 @@ callconv: STDCALL { $$ = CALLCONV_STDCALL; }
| C_CALL { $$ = CALLCONV_CCALL; } | C_CALL { $$ = CALLCONV_CCALL; }
| PASCAL { $$ = CALLCONV_PASCAL; } | PASCAL { $$ = CALLCONV_PASCAL; }
| FASTCALL { $$ = CALLCONV_FASTCALL; } | FASTCALL { $$ = CALLCONV_FASTCALL; }
/* If you leave out the specification of a calling convention, you'll get C's. */
| /*empty*/ { $$ = CALLCONV_CCALL; }
; ;
ext_name: STRING { $$ = mkjust(lsing($1)); } ext_name: STRING { $$ = mkjust(lsing($1)); }
......
...@@ -608,7 +608,7 @@ wlkBinding binding ...@@ -608,7 +608,7 @@ wlkBinding binding
wlkHsType ty `thenUgn` \ h_ty -> wlkHsType ty `thenUgn` \ h_ty ->
wlkExtName ext_name `thenUgn` \ h_ext_name -> wlkExtName ext_name `thenUgn` \ h_ext_name ->
rdCallConv cconv `thenUgn` \ h_cconv -> rdCallConv cconv `thenUgn` \ h_cconv ->
rdImpExp imp_exp (cvFlag unsafe_flag) `thenUgn` \ h_imp_exp -> rdForKind imp_exp (cvFlag unsafe_flag) `thenUgn` \ h_imp_exp ->
returnUgn (RdrForeignDecl (ForeignDecl h_id h_imp_exp h_ty h_ext_name h_cconv src_loc)) returnUgn (RdrForeignDecl (ForeignDecl h_id h_imp_exp h_ty h_ext_name h_cconv src_loc))
a_sig_we_hope -> a_sig_we_hope ->
...@@ -967,8 +967,9 @@ rdCallConv x = returnUgn x ...@@ -967,8 +967,9 @@ rdCallConv x = returnUgn x
rdForKind :: Int -> Bool -> UgnM ForKind rdForKind :: Int -> Bool -> UgnM ForKind
rdForKind 0 isUnsafe = -- foreign import rdForKind 0 isUnsafe = -- foreign import
returnUgn (FoImport isUnsafe) returnUgn (FoImport isUnsafe)
rdImpExp 1 _ = -- foreign export rdForKind 1 _ = -- foreign export
returnUgn FoExport returnUgn FoExport
rdImpExp 2 _ = -- foreign label rdForKind 2 _ = -- foreign label
returnUgn FoLabel returnUgn FoLabel
\end{code} \end{code}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment