fix parse list
add ',' to list function
This commit is contained in:
parent
d60accd444
commit
df44ec05ce
6
parser.c
6
parser.c
@ -110,6 +110,7 @@ atom(FILE *f, char c)
|
|||||||
if(isalpha(c) || strchr(symbolchars, c)){
|
if(isalpha(c) || strchr(symbolchars, c)){
|
||||||
return symbol(f, c);
|
return symbol(f, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
error("bad char in list '%c'", c);
|
error("bad char in list '%c'", c);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -175,6 +176,11 @@ redo:
|
|||||||
res = quote(f, &Bquote, bq);
|
res = quote(f, &Bquote, bq);
|
||||||
*bq -= 1;
|
*bq -= 1;
|
||||||
return res;
|
return res;
|
||||||
|
case ',':
|
||||||
|
if(*bq <= 0)
|
||||||
|
error("comma is illegal outside of backquote");
|
||||||
|
get(f);
|
||||||
|
return newcons(gc, &Comma, list(f, bq));
|
||||||
case '\'':
|
case '\'':
|
||||||
get(f);
|
get(f);
|
||||||
return quote(f, &Quote, bq);
|
return quote(f, &Quote, bq);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user