-/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004, 2006, 2007 Free Software
+/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004, 2006, 2007, 2008 Free Software
* Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
/* `isblank' is only in C99. */
#define CHAR_IS_BLANK_(_chr) \
(((_chr) == ' ') || ((_chr) == '\t') || ((_chr) == '\n') \
- || ((_chr) == '\f'))
+ || ((_chr) == '\f') || ((_chr) == '\r'))
#ifdef MSDOS
# define CHAR_IS_BLANK(_chr) \
(((_chr) <= UCHAR_MAX) ? tolower (_chr) : (_chr))
-/* Helper function similar to `scm_read_token ()'. Read from PORT until a
- whitespace is read. Return zero if the whole token could fit in BUF,
- non-zero otherwise. */
+/* Read an SCSH block comment. */
+static inline SCM scm_read_scsh_block_comment (int chr, SCM port);
+
+/* Read from PORT until a delimiter (e.g., a whitespace) is read. Return
+ zero if the whole token fits in BUF, non-zero otherwise. */
static inline int
read_token (SCM port, char *buf, size_t buf_size, size_t *read)
{
}
break;
+ case '#':
+ switch (c = scm_getc (port))
+ {
+ case EOF:
+ eoferr = "read_sharp";
+ goto goteof;
+ case '!':
+ scm_read_scsh_block_comment (c, port);
+ break;
+ default:
+ scm_ungetc (c, port);
+ return '#';
+ }
+ break;
+
case SCM_LINE_INCREMENTORS:
case SCM_SINGLE_SPACES:
case '\t':
default:
fprintf (stderr, "%s: unhandled quote character (%i)\n",
- __FUNCTION__, chr);
+ "scm_read_quote", chr);
abort ();
}
XXX: This implementation allows sloppy syntaxes like `#: key'. */
symbol = scm_read_expression (port);
if (!scm_is_symbol (symbol))
- scm_i_input_error (__FUNCTION__, port,
+ scm_i_input_error ("scm_read_keyword", port,
"keyword prefix `~a' not followed by a symbol: ~s",
scm_list_2 (SCM_MAKE_CHAR (chr), symbol));