]> Repositorios git - scryer-prolog.git/commitdiff
fix spelling
authorSkgland <[email protected]>
Sat, 10 Jan 2026 16:53:19 +0000 (17:53 +0100)
committerBennet Bleßmann <[email protected]>
Sat, 10 Jan 2026 17:13:59 +0000 (18:13 +0100)
22 files changed:
README.md
_typos.toml [new file with mode: 0644]
benches/README.md
build/instructions_template.rs
clippy.toml
learn/lets-play-brisca.dj
src/arena.rs
src/atom_table.rs
src/ffi.rs
src/machine/dispatch.rs
src/machine/heap.rs
src/machine/lib_machine/mod.rs
src/machine/lib_machine/tests.rs
src/machine/stack.rs
src/machine/system_calls.rs
src/parser/ast.rs
src/repl_helper.rs
src/types.rs
tests/scryer/cli/src_tests/directive_errors.md
tests/scryer/ffi.rs
tests/scryer/src_tests.rs
wambook/errata.txt

index 9132e80ce1b3f712f050d188e159734d4175be95..92fbae2473782930de9a0708fc7877906fb64271 100644 (file)
--- a/README.md
+++ b/README.md
@@ -159,9 +159,9 @@ during the installation of the rust toolchain.
 #### From Crates.io [![Crates.io Version](https://img.shields.io/crates/v/scryer-prolog)](https://crates.io/crates/scryer-prolog) ![Crates.io MSRV](https://img.shields.io/crates/msrv/scryer-prolog)
 
 > [!NOTE]
-> The lates crates.io release can be significantly behind the version available in the git repository
+> The latest crates.io release can be significantly behind the version available in the git repository
 > The crates.io badge in this sections title is a link to the crates.io page.
-> The msrv badge in the section title referece to the minimum rust toolchain version required to compile the latest crates.io release
+> The msrv badge in the section title references the minimum rust toolchain version required to compile the latest crates.io release
 
 `scryer-prolog` is also release on crates.io and can be installed with
 
diff --git a/_typos.toml b/_typos.toml
new file mode 100644 (file)
index 0000000..dc829cd
--- /dev/null
@@ -0,0 +1,31 @@
+# config for https://github.com/crate-ci/typos
+
+[default]
+# example from https://github.com/crate-ci/typos/blob/master/docs/reference.md#example-configurations
+extend-ignore-re = [
+    "(#|//)\\s*spellchecker:ignore-next-line\\n.*"
+]
+
+# correct word key to value 
+# can be used to ignore a typo by adding an entry <typo> = "<typo>"
+[default.extend-words]
+
+# correct identifier key to value 
+# can be used to ignore a typo by adding an entry <typo> = "<typo>"
+[default.extend-identifiers]
+interm = "interm"
+IntermReg = "IntermReg"
+
+
+
+[type.prolog]
+extend-glob = ["*.pl"]
+check-file = false
+
+[type.stdout]
+extend-glob = ["*.stdout"]
+check-file = false
+
+
+[files]
+extend-exclude = ["lib_integration_test_commands.txt"]
\ No newline at end of file
index 1dbf90aae3fc1211173dfa584901ca2e252267df..fa274a37e520f2360a7bd2f7cf9347a98319dc92 100644 (file)
@@ -49,7 +49,7 @@ once.
 
 ## Adding benchmarks
 
-This design is meant to suppoort defining lots of benchmarks.
+This design is meant to support defining lots of benchmarks.
 
 To add a new benchmark:
 
@@ -77,7 +77,7 @@ Some tips:
   cumbersome to run.
 * Consider that the library runtime actually parses the text output of the top
   level. So don't use custom outputs or it will fail to parse. Also keep the
-  output small so it doesn't just benchmark the ouput parsing code.
+  output small so it doesn't just benchmark the output parsing code.
 * DO test the output of the benchmark run, we don't want to count broken
   benchmarks.
 
index 06f71edbd73fed5fc3b9d90efabab6cbdde877b1..954c35c7c9c655a103e567d2ef36fdb19de31e01 100644 (file)
@@ -13,7 +13,7 @@ use to_syn_value_derive::ToDeriveInput;
  * This crate exists to generate the Instruction enum in
  * src/instructions.rs and its adjoining impl functions. The types
  * defined in it are empty and serve only as schema for the generation
- * of Instruction. They mimick most of the structure of the previous
+ * of Instruction. They mimic most of the structure of the previous
  * Line instruction type. The strum crate is used to provide reflection
  * on each of the node types to the tree walker.
 */
index 523192fe77ea3711ff3318a1354405c21c892249..1f7b664b8c662a08e95a4d11ae6607583d52cccb 100644 (file)
@@ -9,7 +9,7 @@ disallowed-macros = [
 disallowed-methods = [
     # https://rust-lang.github.io/rust-clippy/master/#disallowed_method
 
-    # list of methods that may panic on allocation failue 
+    # list of methods that may panic on allocation failur
     # though not including things that can be used correctly by reversing ahead of time (i.e. std::vec::Vec::try_reserve + std::iter::Extend::extend ).
 
     # "std::iter::Iter::collect",
index 438732863aa495494df4f7c2e3e6afefa1b68cd1..a2422f6af0d77e60b32fc8ba00931847ecb238df 100644 (file)
@@ -23,7 +23,7 @@ The rules for knowing which players takes the round are the following:
 
 First, we need to decide a representation of our cards. Coming from another languages we can think that a good representation might be a class or a struct, with two fields, one for the number and the other for the suite, but Prolog doesn't have objects. We can use a list with two elements. But lists are better when we're dealing with variable length data. We could also use a compound term. This is the right choice if our fields are fixed.
 
-A compound term is defined by an atom, followed by the data itself enclosed by parenthesis and separated by comma. Like this: `card(oros, 4)`. Yes, very similar to predicates. In fact the only difference is how we use them, because they're the same. If we pass a compund term in the first level of a query, or inside a call/N, Prolog will treat it as code instead of data. This is one the the examples of Prolog being a homoiconic language.
+A compound term is defined by an atom, followed by the data itself enclosed by parenthesis and separated by comma. Like this: `card(oros, 4)`. Yes, very similar to predicates. In fact the only difference is how we use them, because they're the same. If we pass a compound term in the first level of a query, or inside a call/N, Prolog will treat it as code instead of data. This is one the the examples of Prolog being a homoiconic language.
 
 We can go further, Prolog is very flexible and we can define custom operators easily if we want. Those are also compound terms, but with a different syntax. There's an operator already defined that is very useful for us: the dash. We can just join two pieces of data with a dash, and they'll be together in the same structure. This is usually called "pair".
 
@@ -98,7 +98,7 @@ cards_score_(X) -->
     cards_score_(X1).
 ```
 
-In DCGs, to match an item of the sequence, we use brackets. We use braces to introduce normal Prolog code. Calling other DCGs (in this case, the same, as it's a recursive one), it's just calling it again. Notice in this code that we are doing the addition of X0 and X1 when we still don't know the value of X1. This would be an error in the traditional arithmethic system of Prolog, but it's valid with clpz. clpz allows us to have a more declarative arithmethic, at least with integers.
+In DCGs, to match an item of the sequence, we use brackets. We use braces to introduce normal Prolog code. Calling other DCGs (in this case, the same, as it's a recursive one), it's just calling it again. Notice in this code that we are doing the addition of X0 and X1 when we still don't know the value of X1. This would be an error in the traditional arithmetic system of Prolog, but it's valid with clpz. clpz allows us to have a more declarative arithmetic, at least with integers.
 
 Now we can try this code using `phrase/2` which is needed to jump to a DCG.
 
@@ -276,7 +276,7 @@ Let's ask ourselves what is a procedure. It's a sequence. And we have already se
 
 The basic idea however is having _explicit_ states. The predicates that we're going to write will take an state (a view of the world at a certain point) and will give us the next state.
 
-Let's define the state first. In a game of Brisca we have players. Each player has the three cards he can choose to put (less if we're running out of cards) and the cards he has got from winning rounds. Aditionally we have a stock, a trump suite and the order to play, which is usually from the player who won the last round and going to the right.  We could store the data in a list, with different compound terms:
+Let's define the state first. In a game of Brisca we have players. Each player has the three cards he can choose to put (less if we're running out of cards) and the cards he has got from winning rounds. Additionally we have a stock, a trump suite and the order to play, which is usually from the player who won the last round and going to the right.  We could store the data in a list, with different compound terms:
 
 ```
 [players([player(Name, PlayableCards, WonCards), player(Name, PlayableCards, WonCards), ...]), stock(Cards), trump(Trump)]
index c27ed5f46c1508ace4e5570a5fd2a27410a82b0a..ab108e0297a0c03e01ae73826f785b424e3a5a07 100644 (file)
@@ -445,7 +445,7 @@ impl<T: ?Sized + ArenaAllocated> TypedAllocSlab<T> {
     pub fn to_untyped(self: Box<Self>) -> (TypedArenaPtr<T>, UntypedArenaSlab) {
         let raw_box = Box::into_raw(self);
 
-        // safety: the pointer from Box::into_raw fullfills addr_of_mut's saftey requirements
+        // safety: the pointer from Box::into_raw fulfills addr_of_mut's safety requirements
         let payload_ptr = unsafe { addr_of_mut!((*raw_box).payload) };
 
         (
index d9e970db57dc8d567ed9739614ec7c426bb6ff1b..7a0a818e4972e477cda0d01ef7b2ea8deb14052a 100644 (file)
@@ -540,7 +540,7 @@ impl AtomTable {
                 table.insert(atom);
                 block_epoch.table.replace(table);
 
-                // expicit drop to ensure we don't accidentally drop it early
+                // explicit drop to ensure we don't accidentally drop it early
                 drop(update_guard);
 
                 return atom;
index 5545b397fc926b6728c5fb2b3619002a20926959..e2e996f2787b4447cf273f1e1f8156a4eae598f9 100644 (file)
@@ -981,7 +981,7 @@ pub enum FfiError {
         got: usize,
     },
     AllocationFailed,
-    // LayoutError should never occour
+    // LayoutError should never occur
     LayoutError,
     UnsupportedTypedef,
     UnsupportedAbi,
index cbf7d941b31fef9fe844030e106724550ba199b2..f67b0df2091d2153fbe7241fccc79f36d5e0dd7d 100644 (file)
@@ -310,7 +310,7 @@ impl MachineState {
                     self.throw_interrupt_exception();
                     self.backtrack();
 
-                    // We have extracted controll over the Tokio runtime to the calling context for enabling library use case
+                    // We have extracted control over the Tokio runtime to the calling context for enabling library use case
                     // (see https://github.com/mthom/scryer-prolog/pull/1880)
                     // So we only have access to a runtime handle in here and can't shut it down.
                     // Since I'm not aware of the consequences of deactivating this new code which came in while PR 1880
index d8c52ac8fb0ab8d977f6e3308557d3afd547f8ad..70ef0ba348e16b4737aa93e27a11c4995864e43e 100644 (file)
@@ -445,7 +445,7 @@ impl Index<usize> for ReservedHeapSection {
 
 /// Computes the number of bytes required to pad a string of length `chunk_len`
 /// with zeroes, such that `chunk_len + pstr_sentinel_length(chunk_len)` is a
-/// multiple of `Heap::heap_cell_alignement()`.
+/// multiple of `Heap::heap_cell_alignment()`.
 fn pstr_sentinel_length(chunk_len: usize) -> usize {
     let res = chunk_len.next_multiple_of(ALIGN) - chunk_len;
 
index b4409aa5b741f48ba99144aca3fbb78af1f1d655..75aeffc6420551bd51dcefddb5862381e4b1ba96 100644 (file)
@@ -415,7 +415,7 @@ pub struct QueryState<'a> {
 
 impl Drop for QueryState<'_> {
     fn drop(&mut self) {
-        // FIXME: This may be wrong if the iterator is not fully consumend, but from testing it
+        // FIXME: This may be wrong if the iterator is not fully consumed, but from testing it
         // seems fine. Is this really ok?
         self.machine.trust_me();
     }
index 5b89d67da59351d35a5f565cd0ff8e087286587e..a83901a4bccdac651ff73823625aa2b7362e352c 100644 (file)
@@ -3,7 +3,7 @@ use crate::MachineBuilder;
 
 #[test]
 #[cfg_attr(miri, ignore = "it takes too long to run")]
-fn programatic_query() {
+fn programmatic_query() {
     let mut machine = MachineBuilder::default().build();
 
     machine.load_module_string(
index 98e1dab813dab664f67b42547209e4de34c424f5..ad9b4755a779cb35a078ce23b9329b3b9d4e0ddf 100644 (file)
@@ -191,7 +191,7 @@ impl Stack {
                 let cell_ptr = new_ptr.add(offset).cast::<HeapCellValue>();
                 ptr::write(cell_ptr.as_ptr(), stack_loc_as_cell!(AndFrame, e, idx + 1));
 
-                // Because in the Index and IndexMut inplementations we need to get this from
+                // Because in the Index and IndexMut implementations we need to get this from
                 // exposed provenance, we need to expose the provenance here, even though we don't
                 // actually use the value for anything. This is a reminder that `expose_provenance`
                 // isn't just a cast from a pointer to an integer but has actual side effects.
@@ -224,7 +224,7 @@ impl Stack {
                 let cell_ptr = new_ptr.byte_add(offset).cast::<HeapCellValue>();
                 ptr::write(cell_ptr.as_ptr(), stack_loc_as_cell!(OrFrame, b, idx));
 
-                // Because in the Index and IndexMut inplementations we need to get this from
+                // Because in the Index and IndexMut implementations we need to get this from
                 // exposed provenance, we need to expose the provenance here, even though we don't
                 // actually use the value for anything. This is a reminder that `expose_provenance`
                 // isn't just a cast from a pointer to an integer but has actual side effects.
index ac13c2e569e7a484d2e5e239e18b3e04d01b3b5a..d2db935ee2060f7282b2d73cf4b4c4dac1b20fe9 100644 (file)
@@ -4292,7 +4292,7 @@ impl Machine {
                 }
                 let value = self.rng.gen_range(lower..upper);
                 // Safety:
-                // - lower and uper bounds are Fixnum values
+                // - lower and upper bounds are Fixnum values
                 // - value is inbetween lower and upper
                 // - fixnums value range has no gaps
                 // so value is also a valid Fixnum value
@@ -4812,7 +4812,7 @@ impl Machine {
                                 if interruption {
                                     self.machine_st.throw_interrupt_exception();
                                     self.machine_st.backtrack();
-                                    // We have extracted controll over the Tokio runtime to the calling context for enabling library use case
+                                    // We have extracted control over the Tokio runtime to the calling context for enabling library use case
                                     // (see https://github.com/mthom/scryer-prolog/pull/1880)
                                     // So we only have access to a runtime handle in here and can't shut it down.
                                     // Since I'm not aware of the consequences of deactivating this new code which came in while PR 1880
index 9fc54c706be78d2ea591c4f7d9d9c24b74824096..ba18d36ede8d732627ea8ba8476216f5d4824a94 100644 (file)
@@ -361,7 +361,7 @@ impl OpDesc {
 
     #[inline]
     pub fn get_spec(self) -> OpDeclSpec {
-        OpDeclSpec::try_from(self.spec()).expect("OpDecl always contains a valud OpDeclSpec")
+        OpDeclSpec::try_from(self.spec()).expect("OpDecl always contains a valid OpDeclSpec")
     }
 
     #[inline]
index afec4fd235135418f31fb5355f233c022722554d..cbf75f6b60a060a36b46ac062670e3b8e1f0f892 100644 (file)
@@ -10,14 +10,14 @@ use crate::atom_table::{AtomString, AtomTable, STATIC_ATOMS_MAP};
 
 // TODO: Maybe add validation to the helper
 pub struct Helper {
-    highligher: MatchingBracketHighlighter,
+    highlighter: MatchingBracketHighlighter,
     pub atoms: Weak<AtomTable>,
 }
 
 impl Helper {
     pub fn new() -> Self {
         Self {
-            highligher: MatchingBracketHighlighter::new(),
+            highlighter: MatchingBracketHighlighter::new(),
             atoms: Weak::new(),
         }
     }
@@ -90,11 +90,11 @@ impl Completer for Helper {
 
 impl Highlighter for Helper {
     fn highlight<'l>(&self, line: &'l str, pos: usize) -> std::borrow::Cow<'l, str> {
-        self.highligher.highlight(line, pos)
+        self.highlighter.highlight(line, pos)
     }
 
     fn highlight_char(&self, line: &str, pos: usize, forced: bool) -> bool {
-        self.highligher.highlight_char(line, pos, forced)
+        self.highlighter.highlight_char(line, pos, forced)
     }
 }
 
index 4549c3eac9d3a342e92c9b36490fce5576afca7f..7cc843bc7a8cdb51f4a4ac3377271e80ece4bd97 100644 (file)
@@ -782,7 +782,7 @@ impl UntypedArenaPtr {
     }
 
     /// # Safety
-    /// - this UntypedArenaPtr actuall pointee type is T
+    /// - this UntypedArenaPtr actual pointee type is T
     /// - the pointer must be non-null
     #[inline]
     pub unsafe fn as_typed_ptr<T: ?Sized + ArenaAllocated>(self) -> TypedArenaPtr<T>
index 4b6c8b43bf0d5678204cd73582c206c9ebcf791c..666180eefbb0c6bd67176643a8adfcb8215e8a24 100644 (file)
@@ -59,7 +59,7 @@ $ scryer-prolog -f --no-add-history tests-pl/invalid_decl10.pl -g halt
 
 ```
 
-FIXME I belive the following test should result in a `error(instantiation_error,load/1)` error instead of the current error.
+FIXME I believe the following test should result in a `error(instantiation_error,load/1)` error instead of the current error.
 
 ```trycmd
 $ scryer-prolog -f --no-add-history tests-pl/invalid_decl11.pl -g halt
index c76162a2ccee4af4cae3dd3782f78db6585f1789..abe5c9b76aaedf6e628af3dca21f0bf95c6ff1e2 100644 (file)
@@ -13,7 +13,7 @@ const TMP_DIR: &str = env!("CARGO_TARGET_TMPDIR");
 
 // each test is building its own library so that they can easier run in parallel,
 // i.e. don't need to wait for a large dynamic library to compile,
-// also rusts test infra currently has no functionallity for a setup/befor step
+// also rusts test infra currently has no functionality for a setup/befor step
 fn build_dynamic_library(name: &str, src: &str) -> PathBuf {
     let tmp_dir: &Path = TMP_DIR.as_ref();
 
@@ -79,7 +79,6 @@ fn ffi_f64_minus_zero() {
             "##,
     );
 
-    // note: ouput is currently wrong correct would be 1.0,1.0
     load_module_test_with_input(
         "tests-pl/ffi_f64_minus_zero.pl",
         format!("LIB={dynlib_path:?}."),
index f0edd5d866c6fb529f8e19391e2d980e1ef96d57..03049462c4ea41b960dc485e175ed532534efdb8 100644 (file)
@@ -57,8 +57,10 @@ fn rules() {
 #[test]
 #[cfg_attr(miri, ignore = "it takes too long to run")]
 fn setup_call_cleanup_load() {
+    
     load_module_test(
         "src/tests/setup_call_cleanup.pl",
+        // spellchecker:ignore-next-line
         "1+21+31+2>A+B1+G1+2>41+2>B1+2>31+2>31+2>4ba",
     );
 }
index 43ec62d0a09c39d293367ba6a39886934f8bc5f2..1ad15265b1778818ca0047ebe9aac9bd673e3ac7 100644 (file)
@@ -129,7 +129,7 @@ last argument. Easy fix...
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 When allocating a new choice or environment frame on the stack, one
-should use CP (the continuation pointer) insteads of E+1 (the stored
+should use CP (the continuation pointer) instead of E+1 (the stored
 continuation pointer) to find out the number of Y variables to preserve
 in the previous environment frame. This is because the continuation
 pointer is stored on the stack only if an ALLOCATE instruction is used
@@ -158,7 +158,7 @@ re-loaded. The correct code is:
 
 There is a more subtle related bug that usually doesn't matter very 
 much: both cut and neck_cut should also reset HB. If they do not, 
-some uneccessary trailing will occur. This normally doesnt matter 
+some unnecessary trailing will occur. This normally doesnt matter 
 too much (aside from a small performance penalty), but it does turn 
 out to be a problem if you try to implement Older and Rummel's incremental 
 garbage collection algorithm, because you end up with dangling trail