Skip to content

Commit

Permalink
fix README typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ehwan committed Sep 1, 2024
1 parent 739b1c9 commit b337a7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,11 @@ the parser will diverge into multiple states, and will try every paths until it
Of course, there must be single unique path left at the end of parsing (the point where you feed `eof` token).

### Resolving Ambiguities
In GLR parser, there can be both shift/reduce action possible at the same time, this leads to ambiguity of the grammar.
You can resolve the ambiguties through the [reduce action](#reduceaction-optional).
Simply, returning `Result::Err(Error)` from the reduce action will revoke current path.
The `Error` variant type can be defined by [`%err`](#error-type-optional) directive.
And, setting predefined variable `shift: &mut bool` to `false` will revoke the shift action with lookahead token.
- Returning `Result::Err(Error)` from the reduce action will revoke current reducing path.
The `Error` variant type can be defined by [`%err`](#error-type-optional) directive.
- Setting predefined variable `shift: &mut bool` to `false` will revoke the shift action with lookahead token.

Consider the following example:
```rust
Expand Down
7 changes: 4 additions & 3 deletions rusty_lr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@
//! Of course, there must be single unique path left at the end of parsing (the point where you feed `eof` token).
//!
//! ### Resolving Ambiguities
//! In GLR parser, there can be both shift/reduce action possible at the same time, this leads to ambiguity of the grammar.
//! You can resolve the ambiguties through the reduce action.
//! Simply, returning `Result::Err(Error)` from the reduce action will revoke current path.
//! The `Error` variant type can be defined by `%err` directive.
//! And, setting predefined variable `shift: &mut bool` to `false` will revoke the shift action with lookahead token.
//! - Returning `Result::Err(Error)` from the reduce action will revoke current reducing path.
//! The `Error` variant type can be defined by `%err` directive.
//! - Setting predefined variable `shift: &mut bool` to `false` will revoke the shift action with lookahead token.
//!
//! Consider the following example:
//! ```text
Expand Down

0 comments on commit b337a7b

Please sign in to comment.