114 |
* context, a 'Missing expression' error is signalled. */ |
* context, a 'Missing expression' error is signalled. */ |
115 |
static const char s_missing_expression[] = "Missing expression in"; |
static const char s_missing_expression[] = "Missing expression in"; |
116 |
|
|
117 |
|
/* A body may hold an arbitrary number of internal defines, followed by a |
118 |
|
* non-empty sequence of expressions. If a body with an empty sequence of |
119 |
|
* expressions is detected, a 'Missing body expression' error is signalled. |
120 |
|
*/ |
121 |
|
static const char s_missing_body_expression[] = "Missing body expression in"; |
122 |
|
|
123 |
/* If a form is detected that holds more expressions than are allowed in that |
/* If a form is detected that holds more expressions than are allowed in that |
124 |
* context, an 'Extra expression' error is signalled. */ |
* context, an 'Extra expression' error is signalled. */ |
125 |
static const char s_extra_expression[] = "Extra expression in"; |
static const char s_extra_expression[] = "Extra expression in"; |
414 |
|
|
415 |
|
|
416 |
static const char s_test[] = "bad test"; |
static const char s_test[] = "bad test"; |
|
static const char s_body[] = "bad body"; |
|
417 |
static const char s_bindings[] = "bad bindings"; |
static const char s_bindings[] = "bad bindings"; |
418 |
static const char s_duplicate_bindings[] = "duplicate bindings"; |
static const char s_duplicate_bindings[] = "duplicate bindings"; |
419 |
static const char s_variable[] = "bad variable"; |
static const char s_variable[] = "bad variable"; |
1831 |
scm_m_expand_body (SCM xorig, SCM env) |
scm_m_expand_body (SCM xorig, SCM env) |
1832 |
{ |
{ |
1833 |
SCM x = SCM_CDR (xorig), defs = SCM_EOL; |
SCM x = SCM_CDR (xorig), defs = SCM_EOL; |
|
char *what = SCM_ISYMCHARS (SCM_CAR (xorig)) + 2; |
|
1834 |
|
|
1835 |
while (SCM_NIMP (x)) |
while (SCM_NIMP (x)) |
1836 |
{ |
{ |
1865 |
} |
} |
1866 |
} |
} |
1867 |
|
|
1868 |
|
/* FIXME: xorig is already partially memoized and does not hold information |
1869 |
|
* about the file location. */ |
1870 |
|
ASSERT_SYNTAX (SCM_CONSP (x), s_missing_body_expression, xorig); |
1871 |
|
|
1872 |
if (!SCM_NULLP (defs)) |
if (!SCM_NULLP (defs)) |
1873 |
{ |
{ |
1874 |
SCM rvars, inits, body, letrec; |
SCM rvars, inits, body, letrec; |
1881 |
} |
} |
1882 |
else |
else |
1883 |
{ |
{ |
|
SCM_ASSYNT (SCM_CONSP (x), s_body, what); |
|
1884 |
SCM_SETCAR (xorig, SCM_CAR (x)); |
SCM_SETCAR (xorig, SCM_CAR (x)); |
1885 |
SCM_SETCDR (xorig, SCM_CDR (x)); |
SCM_SETCDR (xorig, SCM_CDR (x)); |
1886 |
} |
} |