Skip to content

Commit c8c1f22

Browse files
committed
Fix typos
1 parent f0dfb94 commit c8c1f22

File tree

25 files changed

+125
-123
lines changed

25 files changed

+125
-123
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Run cargo check
2929
run: cargo check
30-
- name: Run cargo check withoult default features
30+
- name: Run cargo check without default features
3131
run: cargo check --no-default-features
3232

3333
test:
@@ -64,7 +64,7 @@ jobs:
6464

6565
- name: Run cargo clippy
6666
run: cargo clippy --workspace --all-targets -- -D warnings
67-
- name: Run cargo clippy withoult default features
67+
- name: Run cargo clippy without default features
6868
run: cargo clippy --workspace --all-targets --no-default-features -- -D warnings
6969

7070
- name: Run cargo doc

bindings/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "twig-sitter"
3-
description = "Alternative rust bindings for the tree-sitter C library"
3+
description = "Alternative Rust bindings for the tree-sitter C library"
44
authors = ["Pascal Kuthe <[email protected]>"]
55
version = "0.1.0"
66
edition = "2021"

bindings/src/grammar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl std::fmt::Debug for Grammar {
2727
}
2828

2929
impl Grammar {
30-
/// Loads a shared library containg a tree sitter grammar with name `name`
30+
/// Loads a shared library containing a tree sitter grammar with name `name`
3131
// from `library_path`.
3232
///
3333
/// # Safety

bindings/src/parser.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Parser {
6565
/// whole. You can also pass multiple disjoint ranges.
6666
///
6767
/// `ranges` must be non-overlapping and sorted.
68-
pub fn set_included_ranges(&mut self, ranges: &[Range]) -> Result<(), InvalidRangesErrror> {
68+
pub fn set_included_ranges(&mut self, ranges: &[Range]) -> Result<(), InvalidRangesError> {
6969
// TODO: save some memory by only storing byte ranges and converting them to TS ranges in an
7070
// internal buffer here. Points are not used by TS. Alternatively we can path the TS C code
7171
// to accept a simple pair (struct with two fields) of byte positions here instead of a full
@@ -76,7 +76,7 @@ impl Parser {
7676
if success {
7777
Ok(())
7878
} else {
79-
Err(InvalidRangesErrror)
79+
Err(InvalidRangesError)
8080
}
8181
}
8282

@@ -144,14 +144,14 @@ impl Drop for Parser {
144144
/// An error that occurred when trying to assign an incompatible [`Grammar`] to
145145
/// a [`Parser`].
146146
#[derive(Debug, PartialEq, Eq)]
147-
pub struct InvalidRangesErrror;
147+
pub struct InvalidRangesError;
148148

149-
impl fmt::Display for InvalidRangesErrror {
149+
impl fmt::Display for InvalidRangesError {
150150
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
151151
write!(f, "include ranges overlap or are not sorted",)
152152
}
153153
}
154-
impl std::error::Error for InvalidRangesErrror {}
154+
impl std::error::Error for InvalidRangesError {}
155155

156156
type TreeSitterReadFn = unsafe extern "C" fn(
157157
payload: NonNull<c_void>,

bindings/src/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl QueryStr {
312312
#[derive(Debug, PartialEq, Eq)]
313313
pub struct ParserErrorLocation {
314314
pub path: PathBuf,
315-
/// at which line the error occured
315+
/// at which line the error occurred
316316
pub line: u32,
317317
/// at which codepoints/columns the errors starts in the line
318318
pub column: u32,

bindings/src/query/predicate.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl TextPredicate {
8181
}
8282
}
8383

84-
pub fn satsified<I: TsInput>(
84+
pub fn satisfied<I: TsInput>(
8585
&self,
8686
input: &mut I,
8787
matched_nodes: &[MatchedNode],
@@ -230,7 +230,7 @@ impl Query {
230230
});
231231
}
232232

233-
// is and is-not are better handeled as custom predicates since interpreting is context dependent
233+
// is and is-not are better handled as custom predicates since interpreting is context dependent
234234
// "is?" => property_predicates.push((QueryProperty::parse(&predicate), false)),
235235
// "is-not?" => property_predicates.push((QueryProperty::parse(&predicate), true)),
236236
_ => custom_predicate(pattern, UserPredicate::Other(predicate))?,
@@ -375,7 +375,7 @@ impl Error for InvalidPredicateError {}
375375
#[repr(C)]
376376
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
377377
// warns about never being constructed but it's constructed by C code
378-
// and wrwitten into a mutable reference
378+
// and written into a mutable reference
379379
#[allow(dead_code)]
380380
enum PredicateStepKind {
381381
Done = 0,
@@ -406,15 +406,17 @@ extern "C" {
406406
/// Get all of the predicates for the given pattern in the query. The
407407
/// predicates are represented as a single array of steps. There are three
408408
/// types of steps in this array, which correspond to the three legal values
409-
/// for the `type` field: - `TSQueryPredicateStepTypeCapture` - Steps with
410-
/// this type represent names of captures. Their `value_id` can be used
411-
/// with the [`ts_query_capture_name_for_id`] function to obtain the name
412-
/// of the capture. - `TSQueryPredicateStepTypeString` - Steps with this
413-
/// type represent literal strings. Their `value_id` can be used with the
414-
/// [`ts_query_string_value_for_id`] function to obtain their string value.
415-
/// - `TSQueryPredicateStepTypeDone` - Steps with this type are *sentinels*
416-
/// that represent the end of an individual predicate. If a pattern has two
417-
/// predicates, then there will be two steps with this `type` in the array.
409+
/// for the `type` field:
410+
///
411+
/// - `TSQueryPredicateStepTypeCapture` - Steps with this type represent names of captures.
412+
/// Their `value_id` can be used with the [`ts_query_capture_name_for_id`] function to
413+
/// obtain the name of the capture.
414+
/// - `TSQueryPredicateStepTypeString` - Steps with this type represent literal strings.
415+
/// Their `value_id` can be used with the [`ts_query_string_value_for_id`] function to
416+
/// obtain their string value.
417+
/// - `TSQueryPredicateStepTypeDone` - Steps with this type are *sentinels* that represent the
418+
/// end of an individual predicate. If a pattern has two predicates, then there will be two
419+
/// steps with this `type` in the array.
418420
fn ts_query_predicates_for_pattern(
419421
query: NonNull<QueryData>,
420422
pattern_index: u32,

bindings/src/query_cursor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ thread_local! {
1515
static CURSOR_CACHE: UnsafeCell<Vec<InactiveQueryCursor>> = UnsafeCell::new(Vec::with_capacity(8));
1616
}
1717

18-
/// SAFETY: must not call itself recuresively
18+
/// SAFETY: must not call itself recursively
1919
unsafe fn with_cache<T>(f: impl FnOnce(&mut Vec<InactiveQueryCursor>) -> T) -> T {
2020
CURSOR_CACHE.with(|cache| f(&mut *cache.get()))
2121
}
@@ -51,7 +51,7 @@ impl<'tree, I: TsInput> QueryCursor<'_, 'tree, I> {
5151
.query
5252
.pattern_text_predicates(query_match.pattern_index)
5353
.iter()
54-
.all(|predicate| predicate.satsified(&mut self.input, matched_nodes, self.query));
54+
.all(|predicate| predicate.satisfied(&mut self.input, matched_nodes, self.query));
5555
if satisfies_predicates {
5656
let res = QueryMatch {
5757
id: query_match.id,
@@ -90,7 +90,7 @@ impl<'tree, I: TsInput> QueryCursor<'_, 'tree, I> {
9090
.query
9191
.pattern_text_predicates(query_match.pattern_index)
9292
.iter()
93-
.all(|predicate| predicate.satsified(&mut self.input, matched_nodes, self.query));
93+
.all(|predicate| predicate.satisfied(&mut self.input, matched_nodes, self.query));
9494
if satisfies_predicates {
9595
let res = QueryMatch {
9696
id: query_match.id,

bindings/src/ropey.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ impl<'a> TsInput for RopeTsInput<'a> {
3939
"parser offset out of bounds: {offset} > {}",
4040
self.src.len_bytes()
4141
);
42-
// this cursor is optimized for contigous reads which are by far the most common during parsing
43-
// very far jumps (like injections at the other end of the document) are handelde
42+
// this cursor is optimized for contiguous reads which are by far the most common during parsing
43+
// very far jumps (like injections at the other end of the document) are handled
4444
// by starting a new cursor (new chunks iterator)
4545
if offset < self.cursor.offset() || offset - self.cursor.offset() > 4906 {
4646
self.cursor = regex_cursor::RopeyCursor::at(self.src, offset);

bindings/src/syntax_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub struct InputEdit {
6565
impl InputEdit {
6666
/// returns the offset between the old end of the edit and the new end of
6767
/// the edit. This offset needs to be added to every position that occurs
68-
/// ofter `self.old_end_byte` to may it to its old position
68+
/// after `self.old_end_byte` to may it to its old position
6969
///
7070
/// This function assumes that the the source-file is smaller than 2GiB
7171
pub fn offset(&self) -> i32 {

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "skidder-cli"
33
version = "0.1.0"
44
edition = "2021"
5-
description = "A package mangager for tree-sitter"
5+
description = "A package manager for tree-sitter"
66
authors = ["Pascal Kuthe <[email protected]>"]
77
license = "MPL-2.0"
88
repository = "https://github.com/helix-editor/sappling"

0 commit comments

Comments
 (0)