Commit 4a20aa14 authored by Marius Gerbershagen's avatar Marius Gerbershagen
Browse files

reader: signal error on invalid macro dispatch characters

    Before the recent changes to be more ANSI compliant
    with *read-suppress* (commit
    07391b9c),
    dispatch_macro_character would complain that no dispatch function
    was defined. Now we explicitely signal an error.
parent 4d3df376
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment