compile '$atts' and '$project_atts' modules using loader.pl

This commit is contained in:
Mark Thom
2023-02-17 19:20:28 -07:00
parent 601ff567e3
commit a6e416f13d
3 changed files with 13 additions and 27 deletions

View File

@@ -620,7 +620,7 @@ strip_module(Goal, M, G) :-
strip_subst_module(Goal, M1, M2, G) :- strip_subst_module(Goal, M1, M2, G) :-
'$strip_module'(Goal, M2, G), '$strip_module'(Goal, M2, G),
( var(M2) -> ( var(M2), \+ functor(Goal, (:), 2) ->
M2 = M1 M2 = M1
; true ; true
). ).

View File

@@ -255,31 +255,22 @@ impl Machine {
let mut path_buf = current_dir(); let mut path_buf = current_dir();
path_buf.push("machine/attributed_variables.pl"); path_buf.push("machine/attributed_variables.pl");
bootstrapping_compile( let stream = Stream::from_static_string(
Stream::from_static_string(
include_str!("attributed_variables.pl"), include_str!("attributed_variables.pl"),
&mut self.machine_st.arena, &mut self.machine_st.arena,
), );
self,
ListingSource::from_file_and_path( self.load_file(path_buf.to_str().unwrap(), stream);
atom!("attributed_variables"),
path_buf,
),
)
.unwrap();
let mut path_buf = current_dir(); let mut path_buf = current_dir();
path_buf.push("machine/project_attributes.pl"); path_buf.push("machine/project_attributes.pl");
bootstrapping_compile( let stream = Stream::from_static_string(
Stream::from_static_string(
include_str!("project_attributes.pl"), include_str!("project_attributes.pl"),
&mut self.machine_st.arena, &mut self.machine_st.arena,
), );
self,
ListingSource::from_file_and_path(atom!("project_attributes"), path_buf), self.load_file(path_buf.to_str().unwrap(), stream);
)
.unwrap();
if let Some(module) = self.indices.modules.get(&atom!("$atts")) { if let Some(module) = self.indices.modules.get(&atom!("$atts")) {
if let Some(code_index) = module.code_dir.get(&(atom!("driver"), 2)) { if let Some(code_index) = module.code_dir.get(&(atom!("driver"), 2)) {

View File

@@ -25,11 +25,6 @@ call_project_attributes([Module|Modules], QueryVars, AttrVars) :-
), ),
call_project_attributes(Modules, QueryVars, AttrVars). call_project_attributes(Modules, QueryVars, AttrVars).
call_attribute_goals([], _, _).
call_attribute_goals([Module|Modules], GoalCaller, AttrVars) :-
call(GoalCaller, AttrVars, Module, Goals),
call_attribute_goals(Modules, GoalCaller, AttrVars).
'$print_attribute_goals_exception'(Module, E) :- '$print_attribute_goals_exception'(Module, E) :-
( E = error(evaluation_error((Module:attribute_goals)/3), attribute_goals/3) ( E = error(evaluation_error((Module:attribute_goals)/3), attribute_goals/3)
; E = error(existence_error(procedure, attribute_goals/3), attribute_goals/3) ; E = error(existence_error(procedure, attribute_goals/3), attribute_goals/3)