cex: fix reporting of null nonterminals

I implemented this to print A ::= [ ], but A ::= [ %empty ] might be
clearer.

* src/parse-simulation.c (nullable_closure): Don't generate null
nonterminal derivations as leaves.
* src/derivation.c (derivation_print_impl): Don't print seperator
spaces for null nonterminal.
* tests/counterexample.at: Update test results.
This commit is contained in:
Vincent Imbimbo
2020-06-21 16:20:45 -04:00
committed by Akim Demaille
parent 3dd8f2305a
commit 69e3b405d9
3 changed files with 35 additions and 21 deletions

View File

@@ -426,7 +426,7 @@ nullable_closure (parse_state *ps, state_item *si, parse_state_list state_list)
state_item *nsi = state_items + sin;
current_ps = copy_parse_state (false, current_ps);
ps_si_append (current_ps, nsi);
ps_derivs_append (current_ps, derivation_new_leaf (sp));
ps_derivs_append (current_ps, derivation_new (sp, derivation_list_new ()));
parse_state_list_append (state_list, current_ps);
}
}