mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 13:52:16 -08:00
ECL now recognizes all ASCII control-character abbreviations
This commit is contained in:
parent
89a8201b0b
commit
fddeee8bb8
2 changed files with 30 additions and 12 deletions
|
|
@ -144,3 +144,28 @@ ecl_def_string_array(char_names,static,const) = {
|
|||
ecl_def_string_array_elt("Rubout"),
|
||||
ecl_def_string_array_elt(0)
|
||||
};
|
||||
|
||||
/* Linefeed is redundant with one of the names given in
|
||||
* iso_latin_names.h, but it can not be associated to the code
|
||||
* 10, because the default name must be Newline. Similar to
|
||||
* the other codes. */
|
||||
ecl_def_string_array(extra_char_names,static,const) = {
|
||||
ecl_def_string_array_elt("Null"), /* 0 */
|
||||
ecl_def_string_array_elt("Bell"), /* 7 */
|
||||
ecl_def_string_array_elt("Bs"), /* 8 */
|
||||
ecl_def_string_array_elt("Ht"), /* 9 */
|
||||
ecl_def_string_array_elt("Linefeed"), /* 10 */
|
||||
ecl_def_string_array_elt("Lf"), /* 10 */
|
||||
ecl_def_string_array_elt("Escape"), /* 27 */
|
||||
ecl_def_string_array_elt("Ff"), /* 12 */
|
||||
ecl_def_string_array_elt("Cr"), /* 13 */
|
||||
ecl_def_string_array_elt("Sp"), /* 32 */
|
||||
ecl_def_string_array_elt("Del") /* 127 */
|
||||
};
|
||||
|
||||
static const unsigned char extra_char_codes[] = {
|
||||
0, 7, 8, 9, 10, 10, 27, 12, 13, 32, 127
|
||||
};
|
||||
|
||||
#define extra_char_names_size 11
|
||||
|
||||
|
|
|
|||
17
src/c/main.d
17
src/c/main.d
|
|
@ -310,10 +310,6 @@ ecl_def_ct_base_string(str_multiprocessing,"MULTIPROCESSING",15,static,const);
|
|||
#ifdef ECL_CLOS_STREAMS
|
||||
ecl_def_ct_base_string(str_gray,"GRAY",4,static,const);
|
||||
#endif
|
||||
ecl_def_ct_base_string(str_null,"Null",4,static,const);
|
||||
ecl_def_ct_base_string(str_linefeed,"Linefeed",8,static,const);
|
||||
ecl_def_ct_base_string(str_bell,"Bell",4,static,const);
|
||||
ecl_def_ct_base_string(str_escape,"Escape",6,static,const);
|
||||
ecl_def_ct_base_string(str_star_dot_star,"*.*",3,static,const);
|
||||
ecl_def_ct_base_string(str_rel_star_dot_star,"./*.*",5,static,const);
|
||||
ecl_def_ct_base_string(str_empty,"",0,static,const);
|
||||
|
|
@ -667,14 +663,11 @@ cl_boot(int argc, char **argv)
|
|||
ecl_sethash(name, aux, code);
|
||||
ecl_sethash(code, aux, name);
|
||||
}
|
||||
/* Linefeed is redundant with one of the names given in
|
||||
* iso_latin_names.h, but it can not be associated to the code
|
||||
* 10, because the default name must be Newline. Similar to
|
||||
* the other codes. */
|
||||
ecl_sethash(str_null, aux, ecl_make_fixnum(0));
|
||||
ecl_sethash(str_linefeed, aux, ecl_make_fixnum(10));
|
||||
ecl_sethash(str_bell, aux, ecl_make_fixnum(7));
|
||||
ecl_sethash(str_escape, aux, ecl_make_fixnum(27));
|
||||
for (i = 0; i < extra_char_names_size; i++) {
|
||||
cl_object name = (cl_object)(extra_char_names + i);
|
||||
cl_object code = ecl_make_fixnum(extra_char_codes[i]);
|
||||
ecl_sethash(name, aux, code);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize logical pathname translations. This must come after
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue