mirror of
https://github.com/antirez/aocla
synced 2025-01-13 20:01:40 +01:00
Tuples are only made of lowercase single letters.
This commit is contained in:
parent
4a0f0bb206
commit
0dcacdcf06
1 changed files with 3 additions and 2 deletions
5
aocla.c
5
aocla.c
|
@ -176,12 +176,13 @@ obj *parseList(aoclactx *ctx, const char *s, const char **next) {
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (o->type == OBJ_TYPE_TUPLE &&
|
} else if (o->type == OBJ_TYPE_TUPLE &&
|
||||||
(element->type != OBJ_TYPE_SYMBOL ||
|
(element->type != OBJ_TYPE_SYMBOL ||
|
||||||
element->sym.len != 1))
|
element->sym.len != 1 ||
|
||||||
|
!islower(element->sym.ptr[0])))
|
||||||
{
|
{
|
||||||
/* Tuples can be only composed of one character symbols. */
|
/* Tuples can be only composed of one character symbols. */
|
||||||
release(element);
|
release(element);
|
||||||
release(o);
|
release(o);
|
||||||
setError(ctx,s,"Non symbol object in tuple");
|
setError(ctx,s,"Non lower case letter in tuple");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
o->l.ele = myrealloc(o->l.ele, sizeof(obj*)*(o->l.len+1));
|
o->l.ele = myrealloc(o->l.ele, sizeof(obj*)*(o->l.len+1));
|
||||||
|
|
Loading…
Reference in a new issue