]> Repositorios git - scryer-prolog.git/commitdiff
change wording of QueryCannotBePostedAsFact to QueryCannotBeDefinedAsFact, remove...
authorMark Thom <[email protected]>
Sun, 12 Apr 2020 22:01:53 +0000 (16:01 -0600)
committerMark Thom <[email protected]>
Sun, 12 Apr 2020 22:01:53 +0000 (16:01 -0600)
src/prolog/machine/machine_errors.rs
src/prolog/machine/toplevel.rs
src/prolog/read.rs
src/prolog/write.rs

index 85bde23da12b8172185b336e96af17c276ded3c8..f57c169aa03056452379bb5d24be2848a58ac029 100644 (file)
@@ -358,12 +358,12 @@ impl MachineError {
             SessionError::ParserError(err) => {
                 Self::syntax_error(h, err)
             }
-            SessionError::QueryCannotBePostedAsGoal => {
+            SessionError::QueryCannotBeDefinedAsFact => {
                 Self::permission_error(
                     h,
                     Permission::Create,
                     "static_procedure",
-                    functor!("query_cannot_be_posted_as_goal")
+                    functor!("query_cannot_be_defined_as_fact")
                 )
             }
         }
@@ -707,7 +707,7 @@ pub enum SessionError {
     ModuleDoesNotContainExport(ClauseName, PredicateKey),
     NamelessEntry,
     OpIsInfixAndPostFix(ClauseName),
-    QueryCannotBePostedAsGoal,
+    QueryCannotBeDefinedAsFact,
     ParserError(ParserError),
 }
 
index 717f173ec3d7e7f9f59aac100628b76e45bfd4c4..7cb56cc60691cb1057b88e65831985cbf579c5d6 100644 (file)
@@ -1290,7 +1290,7 @@ impl<'a> TopLevelBatchWorker<'a> {
                 TopLevel::Declaration(decl) =>
                     return Ok(Some(decl)),
                 TopLevel::Query(_) =>
-                    return Err(SessionError::QueryCannotBePostedAsGoal),
+                    return Err(SessionError::QueryCannotBeDefinedAsFact),
             }
         }
 
index 4162aedefbc7667c9f3f801b0faae655cbb88a1c..a04b13d161c0bf51cd3e8e07058ec2097a988c96 100644 (file)
@@ -167,38 +167,8 @@ impl<'a> TermWriter<'a> {
             &TermRef::Clause(..) => {
                 Addr::Str(h)
             }
-            &TermRef::PartialString(..) => {//_, _, ref pstr, tail) => {
+            &TermRef::PartialString(..) => {
                 Addr::PStrLocation(h, 0)
-                /*
-                match tail {
-                    Term::AnonVar => {
-                        let h = self.machine_st.heap.h();
-                        self.machine_st.heap.allocate_pstr(pstr);
-
-                        Addr::PStrLocation(h, 0)
-                    }
-                    Term::Constant(_, Constant::EmptyList) => {
-                        self.machine_st.heap.put_complete_string(pstr)
-                    }
-                    Term::Var(_, ref var) => {
-                        let h = self.machine_st.heap.h();
-
-                        self.machine_st.heap.allocate_pstr(pstr);
-                        let tail_h = self.machine_st.heap.h() - 1;
-
-                        if let Some(addr) = self.var_dict.get(var) {
-                            self.machine_st.heap[tail_h] = HeapCellValue::Addr(*addr);
-                        } else {
-                            self.var_dict.insert(var.clone(), Addr::HeapCell(tail_h));
-                        }
-
-                        Addr::PStrLocation(h, 0)
-                    }
-                    _ => {
-                        unreachable!()
-                    }
-                }
-                */
             }
         }
     }
index 129d480cae1303b8544cb64d51de3defec042c1e..9c2267ae0d6d5400caed5d4f5ab148cdbeb22ea6 100644 (file)
@@ -319,8 +319,8 @@ impl fmt::Display for SessionError {
             &SessionError::ParserError(ref e) => {
                 write!(f, "syntax_error({})", e.as_str())
             }
-            &SessionError::QueryCannotBePostedAsGoal => {
-                write!(f, "query forms cannot be posted as goals.")
+            &SessionError::QueryCannotBeDefinedAsFact => {
+                write!(f, "queries cannot be defined as facts.")
             }
         }
     }