mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 13:01:42 -08:00
reader: signal error on invalid macro dispatch characters
Before the recent changes to be more ANSI compliant
with *read-suppress* (commit
07391b9ced),
dispatch_macro_character would complain that no dispatch function
was defined. Now we explicitely signal an error.
This commit is contained in:
parent
4d3df3766b
commit
4a20aa14f4
1 changed files with 25 additions and 0 deletions
25
src/c/read.d
25
src/c/read.d
|
|
@ -635,6 +635,13 @@ semicolon_reader(cl_object in, cl_object c)
|
|||
sharpmacro routines
|
||||
*/
|
||||
|
||||
static cl_object
|
||||
sharp_generic_error(cl_object in, cl_object c, cl_object n)
|
||||
{
|
||||
FEreader_error("The character ~:C is not a valid dispatch macro character",
|
||||
in, 1, c);
|
||||
}
|
||||
|
||||
static cl_object
|
||||
sharp_C_reader(cl_object in, cl_object c, cl_object d)
|
||||
{
|
||||
|
|
@ -2110,6 +2117,24 @@ init_read(void)
|
|||
make_cf3(sharp_minus_reader), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('|'),
|
||||
make_cf3(sharp_vertical_bar_reader), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('\b'),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('\t'),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR(ECL_CHAR_CODE_NEWLINE),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR(ECL_CHAR_CODE_LINEFEED),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('\f'),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR(ECL_CHAR_CODE_RETURN),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR(' '),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR(')'),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('<'),
|
||||
make_cf3(sharp_generic_error), r);
|
||||
/* This is specific to this implementation */
|
||||
cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('$'),
|
||||
make_cf3(sharp_dollar_reader), r);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue