]> Repositorios git - scryer-prolog.git/commitdiff
Emit warnings as Prolog comments
authorbakaq <[email protected]>
Sat, 30 Dec 2023 20:39:20 +0000 (17:39 -0300)
committerbakaq <[email protected]>
Sat, 30 Dec 2023 20:39:20 +0000 (17:39 -0300)
src/loader.pl
src/machine/compile.rs
src/machine/mod.rs
src/read.rs
src/toplevel.pl
tests/scryer/cli/issues/singleton_warning.stdout

index 18b04abf2c007fd67d1921071bfa2537f851abb1..49d769bb029469f71107e2a4b40f8bd925271220 100644 (file)
@@ -112,7 +112,7 @@ success_or_warning(Goal) :-
     (   call(Goal) ->
         true
     ;   %% initialization goals can fail without thwarting the load.
-        write('Warning: initialization/1 failed for: '),
+        write('Warning: initialization/1 failed for: '),
         writeq(Goal),
         nl
     ).
@@ -188,7 +188,7 @@ warn_about_singletons([], _).
 warn_about_singletons([Singleton|Singletons], LinesRead) :-
     (  filter_anonymous_vars([Singleton|Singletons], VarEqs),
        VarEqs \== [] ->
-       write('Warning: singleton variables '),
+       write('Warning: singleton variables '),
        print_comma_separated_list(VarEqs),
        write(' at line '),
        write(LinesRead),
@@ -286,7 +286,7 @@ module_expanded_head_variables(Head, HeadVars) :-
 
 print_goal_expansion_warning(Pred) :-
     nl,
-    write('Warning: clause body goal expansion failed because '),
+    write('Warning: clause body goal expansion failed because '),
     writeq(Pred),
     write(' is not callable.'),
     nl.
index 68d4da1f78b195df748159005a04c913404ed4b9..7f967e8bda4e793ab0ab0fbf049aa6e18502b9c3 100644 (file)
@@ -1208,7 +1208,7 @@ fn print_overwrite_warning(
     }
 
     println!(
-        "Warning: overwriting {}/{} because the clauses are discontiguous",
+        "Warning: overwriting {}/{} because the clauses are discontiguous",
         key.0.as_str(),
         key.1
     );
@@ -2179,7 +2179,7 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
             if is_cross_module_clause && !local_predicate_info.is_extensible {
                 if predicate_info.is_multifile {
                     println!(
-                        "Warning: overwriting multifile predicate {}:{}/{} because \
+                        "Warning: overwriting multifile predicate {}:{}/{} because \
                               it was not locally declared multifile.",
                         self.payload.predicates.compilation_target,
                         key.0.as_str(),
index 431592c8aa92761d3f7f55c13ad6de9c649973bc..022970f9c4d72695fe96153be4d0135060df340f 100644 (file)
@@ -1130,7 +1130,7 @@ impl Machine {
             }
             Unknown::Warn => {
                 println!(
-                    "warning: predicate {}/{} is undefined",
+                    "% Warning: predicate {}/{} is undefined",
                     name.as_str(),
                     arity
                 );
index 1115bf1a3c04eeef562a76164261e08f29b1d217..c13c02504f4dd86104b16b4b9b0bc777fb75a7b3 100644 (file)
@@ -130,7 +130,7 @@ impl ReadlineStream {
             if let Some(mut path) = dirs_next::home_dir() {
                 path.push(HISTORY_FILE);
                 if path.exists() && rl.load_history(&path).is_err() {
-                    println!("Warning: loading history failed");
+                    println!("Warning: loading history failed");
                 }
             }
 
@@ -213,10 +213,10 @@ impl ReadlineStream {
             path.push(HISTORY_FILE);
             if path.exists() {
                 if self.rl.append_history(&path).is_err() {
-                    println!("Warning: couldn't append history (existing file)");
+                    println!("Warning: couldn't append history (existing file)");
                 }
             } else if self.rl.save_history(&path).is_err() {
-                println!("Warning: couldn't save history (new file)");
+                println!("Warning: couldn't save history (new file)");
             }
         }
     }
index 997ebad9e144d3967532a11e3e3fac8ab3971cdf..4804ecf86064d63d29d19d9865581fa5b351e00a 100644 (file)
@@ -134,7 +134,7 @@ run_goals([g(Gs0)|Goals]) :- !,
                   write_term(Exception, [double_quotes(DQ)]), nl % halt?
               )
         ) -> true
-    ;   write('Warning: initialization failed for: '),
+    ;   write('Warning: initialization failed for: '),
         write_term(Goal, [variable_names(VNs),double_quotes(DQ)]), nl
     ),
     run_goals(Goals).
index 2f5e213df1ac857a4e752e0d7568bdaf6dd6d67a..4c8b718270740df7162895f3aa740a74dae98ff3 100644 (file)
@@ -1,2 +1,2 @@
-Warning: singleton variables X at line 4 of singleton_example.pl
+Warning: singleton variables X at line 4 of singleton_example.pl
    true.