Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typos #361

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions book/src/contributing/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ On this page, you will find all the information needed to run and test your
own version of the Logos crate, locally.

We assume you have basic knowledge with git and GitHub. If that is not the
case, please refer to the link mentionned in [Contributing](./contributing.md).
case, please refer to the link mentioned in [Contributing](./contributing.md).

## Prerequisites

You need to have both git and Rust installed on your computer,
see intallation procedures:
see installation procedures:

+ for [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git);
+ and [Rust](https://www.rust-lang.org/tools/install).
Expand Down
2 changes: 1 addition & 1 deletion book/src/examples/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Once we have our tokens, we must parse them into actual JSON values. We will pro

+ `parse_value` for parsing any JSON object, without prior knowledge of its type;
+ `parse_array` for parsing an array, assuming we matched `[`;
+ and `parse_oject` for parsing an object, assuming we matched `{`.
+ and `parse_object` for parsing an object, assuming we matched `{`.

Starting with parsing an arbitrary value, we can easily obtain the four scalar types, `Bool`, `Null`, `Number`, and `String`, while we will call the next functions for arrays and objects parsing.

Expand Down
2 changes: 1 addition & 1 deletion book/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Because [`Lexer`](https://docs.rs/logos/latest/logos/struct.Lexer.html), returne
for result in Token::lexer("Create ridiculously fast Lexers.") {
match result {
Ok(token) => println!("{:#?}", token),
Err(e) => panic!("some error occured: {}", e),
Err(e) => panic!("some error occurred: {}", e),
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion book/src/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ There are two main types in **Logos**:
with plain string or [regular expression](https://en.wikipedia.org/wiki/Regular_expression)
syntax on `enum` variants as _patterns_ for some input.
+ The `Lexer<T: Logos>`, which is an iterator that takes some input (`&str`,
simetimes `&[u8]`) and performs lexical analysis on the input on the go,
sometimes `&[u8]`) and performs lexical analysis on the input on the go,
producing variants of the enum `T` matching the defined patterns.
2 changes: 1 addition & 1 deletion logos-codegen/src/graph/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ mod tests {
}

#[test]
fn range_iter_bunds() {
fn range_iter_bounds() {
let byte = Range::from(0xFA..=0xFF);

let collected = byte.take(1000).collect::<Vec<_>>();
Expand Down
4 changes: 2 additions & 2 deletions logos-codegen/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ impl Parser {
if tp.qself.is_none() {
// If `ty` is a generic type parameter, try to find
// its concrete type defined with #[logos(type T = Type)]
if let Some(substitue) = self.types.find(&tp.path) {
*ty = substitue;
if let Some(substitute) = self.types.find(&tp.path) {
*ty = substitute;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions logos/examples/brainfuck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! - and ']'.
//!
//! Despite being very hard to use in practice, this makes
//! this language very simple to interpet. The following code
//! this language very simple to interpret. The following code
//! defines an [`execute`] function that runs Brainfuck code.
//!
//! Logos is used here to directly transform the code stream
Expand Down Expand Up @@ -116,7 +116,7 @@ pub fn execute(code: &str) {
}

if !queue.is_empty() {
panic!("Unmatched conditional forward jump at positons {:?}, expecting a closing ']' for each of them", queue);
panic!("Unmatched conditional forward jump at positions {:?}, expecting a closing ']' for each of them", queue);
}

/* ANCHOR: fsm */
Expand Down
2 changes: 1 addition & 1 deletion logos/examples/extras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//!
//! From then, one can easily compute the column number of some token by computing:
//!
//! ```rust,no_run,no_playgroud
//! ```rust,no_run,no_playground
//! fn get_column(lex: &Lexer<Token>) -> usize {
//! lex.span().start - lex.extras.1
//! }
Expand Down
2 changes: 1 addition & 1 deletion logos/examples/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@
/// null.
Null,
/// true or false.
Bool(bool),

Check warning on line 74 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, ubuntu-latest)

field `0` is never read

Check warning on line 74 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, macos-latest)

field `0` is never read

Check warning on line 74 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, windows-latest)

field `0` is never read
/// Any floating point number.
Number(f64),

Check warning on line 76 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, ubuntu-latest)

field `0` is never read

Check warning on line 76 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, macos-latest)

field `0` is never read

Check warning on line 76 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, windows-latest)

field `0` is never read
/// Any quoted string.
String(String),

Check warning on line 78 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, ubuntu-latest)

field `0` is never read

Check warning on line 78 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, macos-latest)

field `0` is never read

Check warning on line 78 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, windows-latest)

field `0` is never read
/// An array of values
Array(Vec<Value>),

Check warning on line 80 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, ubuntu-latest)

field `0` is never read

Check warning on line 80 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, macos-latest)

field `0` is never read

Check warning on line 80 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, windows-latest)

field `0` is never read
/// An dictionnary mapping keys and values.
/// An dictionary mapping keys and values.
Object(HashMap<String, Value>),

Check warning on line 82 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, ubuntu-latest)

field `0` is never read

Check warning on line 82 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, macos-latest)

field `0` is never read

Check warning on line 82 in logos/examples/json.rs

View workflow job for this annotation

GitHub Actions / Tests (nightly, windows-latest)

field `0` is never read
}
/* ANCHOR_END: values */

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn operators() {
}

#[test]
fn punctation() {
fn punctuation() {
assert_lex(
"{ . .. ... }",
&[
Expand Down
Loading