]> Repositorios git - scryer-prolog.git/commitdiff
compile '$atts' and '$project_atts' modules using loader.pl
authorMark Thom <[email protected]>
Sat, 18 Feb 2023 02:20:28 +0000 (19:20 -0700)
committerMark Thom <[email protected]>
Mon, 20 Feb 2023 08:11:35 +0000 (01:11 -0700)
src/loader.pl
src/machine/mod.rs
src/machine/project_attributes.pl

index fe3d6fe25f80460e11844cb7d7024c3f3c7d9941..1faba9e3edb2e6bcf581d4c2941cd7c857f1c503 100644 (file)
@@ -620,7 +620,7 @@ strip_module(Goal, M, G) :-
 
 strip_subst_module(Goal, M1, M2, G) :-
     '$strip_module'(Goal, M2, G),
-    (  var(M2) ->
+    (  var(M2), \+ functor(Goal, (:), 2) ->
        M2 = M1
     ;  true
     ).
index 480f5a15b5076fb023f029a4521f9b5c338ae081..cad806615e0dd210e6ae3cde29a50e50904a9b8c 100644 (file)
@@ -255,31 +255,22 @@ impl Machine {
         let mut path_buf = current_dir();
         path_buf.push("machine/attributed_variables.pl");
 
-        bootstrapping_compile(
-            Stream::from_static_string(
-                include_str!("attributed_variables.pl"),
-                &mut self.machine_st.arena,
-            ),
-            self,
-            ListingSource::from_file_and_path(
-                atom!("attributed_variables"),
-                path_buf,
-            ),
-        )
-        .unwrap();
+        let stream = Stream::from_static_string(
+            include_str!("attributed_variables.pl"),
+            &mut self.machine_st.arena,
+        );
+
+        self.load_file(path_buf.to_str().unwrap(), stream);
 
         let mut path_buf = current_dir();
         path_buf.push("machine/project_attributes.pl");
 
-        bootstrapping_compile(
-            Stream::from_static_string(
-                include_str!("project_attributes.pl"),
-                &mut self.machine_st.arena,
-            ),
-            self,
-            ListingSource::from_file_and_path(atom!("project_attributes"), path_buf),
-        )
-        .unwrap();
+        let stream = Stream::from_static_string(
+            include_str!("project_attributes.pl"),
+            &mut self.machine_st.arena,
+        );
+
+        self.load_file(path_buf.to_str().unwrap(), stream);
 
         if let Some(module) = self.indices.modules.get(&atom!("$atts")) {
             if let Some(code_index) = module.code_dir.get(&(atom!("driver"), 2)) {
index b2f750077820a4d451abfb9546aeab3a93a6567c..66d6adb5f32ed3b6559fc637117e0b18ed2aae74 100644 (file)
@@ -25,11 +25,6 @@ call_project_attributes([Module|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) :-
     (  E = error(evaluation_error((Module:attribute_goals)/3), attribute_goals/3)
     ;  E = error(existence_error(procedure, attribute_goals/3), attribute_goals/3)