mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
Minor tweaks to delimiter handling in read.c
* libguile/read.c (CHAR_IS_R5RS_DELIMITER, CHAR_IS_DELIMITER): Move the '[' and ']' delimiters from CHAR_IS_R5RS_DELIMITER to CHAR_IS_DELIMITER. Parenthesize all references to the macro parameter. Don't check the global square-brackets read option until after we know the character is '[' or ']'. (scm_read_sexp): Don't check the global square-brackets read option until after we know the character is ']'.
This commit is contained in:
parent
493ceb99e5
commit
603234c611
1 changed files with 5 additions and 4 deletions
|
@ -185,10 +185,11 @@ scm_i_read_hash_procedures_set_x (SCM value)
|
|||
structure''). */
|
||||
#define CHAR_IS_R5RS_DELIMITER(c) \
|
||||
(CHAR_IS_BLANK (c) \
|
||||
|| (c == ')') || (c == '(') || (c == ';') || (c == '"') \
|
||||
|| (SCM_SQUARE_BRACKETS_P && ((c == '[') || (c == ']'))))
|
||||
|| (c) == ')' || (c) == '(' || (c) == ';' || (c) == '"')
|
||||
|
||||
#define CHAR_IS_DELIMITER CHAR_IS_R5RS_DELIMITER
|
||||
#define CHAR_IS_DELIMITER(c) \
|
||||
(CHAR_IS_R5RS_DELIMITER (c) \
|
||||
|| (((c) == ']' || (c) == '[') && SCM_SQUARE_BRACKETS_P))
|
||||
|
||||
/* Exponent markers, as defined in section 7.1.1 of R5RS, ``Lexical
|
||||
Structure''. */
|
||||
|
@ -405,7 +406,7 @@ scm_read_sexp (scm_t_wchar chr, SCM port)
|
|||
{
|
||||
SCM new_tail;
|
||||
|
||||
if (c == ')' || (SCM_SQUARE_BRACKETS_P && c == ']'))
|
||||
if (c == ')' || (c == ']' && SCM_SQUARE_BRACKETS_P))
|
||||
scm_i_input_error (FUNC_NAME, port,
|
||||
"in pair: mismatched close paren: ~A",
|
||||
scm_list_1 (SCM_MAKE_CHAR (c)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue