mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 12:53:53 +00:00
Allow `pragma export' declarations for imported predicates.
Estimated hours taken: 1.5 Allow `pragma export' declarations for imported predicates. compiler/prog_io_pragma.m: Don't require the module name for `pragma export' declarations to match the name of the current module. compiler/export.m: Use pred_info_arg_types to get the argument types, rather than proc_info_var_types; this way is simpler, and works for imported predicates.
This commit is contained in:
@@ -150,7 +150,7 @@ parse_pragma_type(ModuleName, "c_code", PragmaTerms,
|
||||
ErrorTerm)
|
||||
).
|
||||
|
||||
parse_pragma_type(ModuleName, "export", PragmaTerms,
|
||||
parse_pragma_type(_ModuleName, "export", PragmaTerms,
|
||||
ErrorTerm, _VarSet, Result) :-
|
||||
(
|
||||
PragmaTerms = [PredAndModesTerm, C_FunctionTerm]
|
||||
@@ -163,7 +163,7 @@ parse_pragma_type(ModuleName, "export", PragmaTerms,
|
||||
PredAndModesTerm = term__functor(term__atom("="),
|
||||
[FuncAndArgModesTerm, RetModeTerm], _)
|
||||
->
|
||||
parse_qualified_term(ModuleName, FuncAndArgModesTerm,
|
||||
parse_qualified_term(FuncAndArgModesTerm,
|
||||
"pragma export declaration", FuncAndArgModesResult),
|
||||
(
|
||||
FuncAndArgModesResult = ok(FuncName, ArgModeTerms),
|
||||
@@ -185,7 +185,7 @@ parse_pragma_type(ModuleName, "export", PragmaTerms,
|
||||
Result = error(Msg, Term)
|
||||
)
|
||||
;
|
||||
parse_qualified_term(ModuleName, PredAndModesTerm,
|
||||
parse_qualified_term(PredAndModesTerm,
|
||||
"pragma export declaration", PredAndModesResult),
|
||||
(
|
||||
PredAndModesResult = ok(PredName, ModeTerms),
|
||||
|
||||
Reference in New Issue
Block a user