mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-07 12:50:34 -08:00
[wip] reader: add faux ecl_string_push_extend
[wip] because: - we need to provide the real method - or/ add dependency on array.d and vector_push.d
This commit is contained in:
parent
7294d0dd64
commit
f4f1f2186f
1 changed files with 29 additions and 3 deletions
|
|
@ -204,6 +204,32 @@ ecl_put_reader_token(cl_object token)
|
|||
the_env->token_pool = CONS(token, pool);
|
||||
}
|
||||
|
||||
static ecl_character
|
||||
_ecl_string_push_extend(cl_object s, ecl_character c)
|
||||
{
|
||||
cl_index dim, fillp;
|
||||
switch(ecl_t_of(s)) {
|
||||
#ifdef ECL_UNICODE
|
||||
case t_string:
|
||||
fillp = s->string.fillp;
|
||||
dim = s->string.dim;
|
||||
if (fillp >= dim) {
|
||||
ecl_internal_error("token is too long!");
|
||||
}
|
||||
return s->string.self[fillp++] = c;
|
||||
#endif
|
||||
case t_base_string:
|
||||
fillp = s->base_string.fillp;
|
||||
dim = s->base_string.dim;
|
||||
if (fillp >= dim) {
|
||||
ecl_internal_error("token is too long!)");
|
||||
}
|
||||
return s->base_string.self[fillp++] = c;
|
||||
default:
|
||||
ecl_internal_error("can't do");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine inverts the case of the characters in the buffer which were not
|
||||
* escaped.
|
||||
|
|
@ -255,7 +281,7 @@ ecl_read_token(cl_object rtbl, cl_object in, int flags)
|
|||
if (a == cat_single_escape) {
|
||||
c = ecl_read_char_noeof(in);
|
||||
a = cat_constituent;
|
||||
ecl_string_push_extend(string, c);
|
||||
_ecl_string_push_extend(string, c);
|
||||
length++;
|
||||
ecl_stack_push(escape, ecl_make_fixnum(length-1));
|
||||
ecl_stack_push(escape, ecl_make_fixnum(length));
|
||||
|
|
@ -271,7 +297,7 @@ ecl_read_token(cl_object rtbl, cl_object in, int flags)
|
|||
a = cat_constituent;
|
||||
} else if (a == cat_multiple_escape)
|
||||
break;
|
||||
ecl_string_push_extend(string, c);
|
||||
_ecl_string_push_extend(string, c);
|
||||
length++;
|
||||
}
|
||||
ecl_stack_push(escape, ecl_make_fixnum(begin));
|
||||
|
|
@ -298,7 +324,7 @@ ecl_read_token(cl_object rtbl, cl_object in, int flags)
|
|||
c = ecl_char_upcase(c);
|
||||
}
|
||||
}
|
||||
ecl_string_push_extend(string, c);
|
||||
_ecl_string_push_extend(string, c);
|
||||
length++;
|
||||
NEXT:
|
||||
c = ecl_read_char(in);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue