Skip to content

Commit

Permalink
fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Specy committed Nov 18, 2024
1 parent 632db26 commit 1f0f04f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion assets/grammars/correct/indirect_empty.lr
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
S -> A B

A -> C
C -> D
D -> ''
B -> 'x'

B -> 'x'
1 change: 1 addition & 0 deletions src/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ impl FirstTable {
pub fn construct(grammar: &Grammar) -> FirstTable {
let mut first_table = IndexMap::new();
let mut indirectly_empty_symbols = IndexSet::new();

let mut done = false;
while !done {
done = true;
Expand Down
3 changes: 2 additions & 1 deletion tests/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ fn raising_correct_error_when_creating_lalr_parser_for_non_lalr_grammar() {

#[test]
#[cfg_attr(target_family = "wasm", wasm_bindgen_test)]
fn correctly_creates_first_and_follow_sets_for_indirectly_empty_grammar() {
fn correctly_creating_first_and_follow_sets_for_indirectly_empty_grammar() {
let grammar = Grammar::parse(common::grammars::INDIRECT_EMPTY).unwrap();
let parser = Parser::lr(grammar).unwrap();

let first_table = parser.first_table();
{
// +--------+-----------+
Expand Down

0 comments on commit 1f0f04f

Please sign in to comment.