mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-11 07:20:29 -07:00
reader: make token parser installable in the readtable
This commit is contained in:
parent
09e8d7dd04
commit
e57ca30637
4 changed files with 5 additions and 1 deletions
|
|
@ -727,6 +727,7 @@ ecl_copy_readtable(cl_object from, cl_object to)
|
|||
*/
|
||||
output = ecl_alloc_object(t_readtable);
|
||||
output->readtable.locked = 0;
|
||||
output->readtable.parse_token = from->readtable.parse_token;
|
||||
output->readtable.table = to_rtab = (struct ecl_readtable_entry *)
|
||||
ecl_alloc_align(total_bytes, entry_bytes);
|
||||
from_rtab = from->readtable.table;
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ ecl_read_object_with_delimiter(cl_object rtbl, cl_object in, int delimiter, int
|
|||
if (suppress) {
|
||||
x = ECL_NIL;
|
||||
} else {
|
||||
x = ecl_parse_token(token, in, flags);
|
||||
x = rtbl->readtable.parse_token(token, in, flags);
|
||||
}
|
||||
ecl_put_reader_token(token);
|
||||
return x;
|
||||
|
|
|
|||
|
|
@ -808,6 +808,7 @@ init_read(void)
|
|||
|
||||
cl_core.standard_readtable = r = ecl_alloc_object(t_readtable);
|
||||
r->readtable.locked = 0;
|
||||
r->readtable.parse_token = ecl_parse_token;
|
||||
r->readtable.read_case = ecl_case_upcase;
|
||||
r->readtable.table = rtab
|
||||
= (struct ecl_readtable_entry *)
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ typedef cl_object cl_return;
|
|||
typedef cl_fixnum cl_narg;
|
||||
typedef cl_object (*cl_objectfn)(cl_narg narg, ...);
|
||||
typedef cl_object (*cl_objectfn_fixed)();
|
||||
typedef cl_object (*cl_objectfn_parse)(cl_object,cl_object,int);
|
||||
|
||||
/*
|
||||
OBJect NULL value.
|
||||
|
|
@ -742,6 +743,7 @@ struct ecl_readtable { /* read table */
|
|||
_ECL_HDR1(locked);
|
||||
enum ecl_readtable_case read_case; /* readtable-case */
|
||||
struct ecl_readtable_entry *table; /* read table itself */
|
||||
cl_objectfn_parse parse_token; /* token parser */
|
||||
#ifdef ECL_UNICODE
|
||||
cl_object hash; /* hash for values outside base-char range */
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue