mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
* libguile/eval.c (scm_m_case): Allow empty lists of case labels.
* test-suite/tests/syntax.test: Fixed and activated test of empty case label support.
This commit is contained in:
parent
2a6f7afe04
commit
58a2510b07
4 changed files with 19 additions and 5 deletions
|
@ -741,6 +741,13 @@ scm_m_case (SCM expr, SCM env)
|
|||
s_bad_case_labels, labels, expr);
|
||||
all_labels = scm_append_x (scm_list_2 (labels, all_labels));
|
||||
}
|
||||
else if (SCM_NULLP (labels))
|
||||
{
|
||||
/* The list of labels is empty. According to R5RS this is allowed.
|
||||
* It means that the sequence of expressions will never be executed.
|
||||
* Therefore, as an optimization, we could remove the whole
|
||||
* clause. */
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT_SYNTAX_2 (SCM_EQ_P (labels, scm_sym_else) && else_literal_p,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue