forked from Lainports/opnsense-ports
48 lines
1.3 KiB
Text
48 lines
1.3 KiB
Text
--- parser_pratt.c 2014-03-25 04:10:42.000000000 -0400
|
|
+++ parser_pratt.c 2021-02-15 22:35:51.027451000 -0500
|
|
@@ -27,9 +27,10 @@
|
|
{return(err("token_overflow",NIL));}
|
|
|
|
-LISP pratt_read_token(LISP buffer,LISP chars,LISP stream)
|
|
+static LISP pratt_read_token(LISP buffer, LISP chars, LISP stream)
|
|
{LISP c,tail;
|
|
char *tk;
|
|
long j=0,tkdim;
|
|
- tk = get_c_string_dim(buffer,&tkdim);
|
|
+ tk = get_string_data(buffer);
|
|
+ tkdim = buffer->storage_as.string.dim;
|
|
while(1)
|
|
if NULLP(c = lgetc(stream))
|
|
@@ -39,5 +40,5 @@
|
|
else if NEQ(sym_whitespace,tail)
|
|
break;
|
|
- if EQ(sym_string_delim,tail)
|
|
+ if EQ(sym_string_delim,tail) {
|
|
while(NNULLP(c = lgetc(stream)))
|
|
if EQ(sym_back_slash,aref1(chars,c))
|
|
@@ -58,4 +59,5 @@
|
|
else
|
|
err_token_overflow();
|
|
+ }
|
|
if EQ(tail,sym_back_slash)
|
|
c = lgetc(stream);
|
|
@@ -66,5 +68,5 @@
|
|
if NULLP(tail)
|
|
return(lreadtk(tk,j));
|
|
- else if CONSP(tail)
|
|
+ else if CONSP(tail) {
|
|
while(1)
|
|
if NULLP(c = lgetc(stream))
|
|
@@ -78,4 +80,5 @@
|
|
{if NEQ(sym_whitespace,aref1(chars,c)) lungetc(c,stream);
|
|
return(lreadtk(tk,j));}
|
|
+ }
|
|
while(1)
|
|
if NULLP(c = lgetc(stream))
|
|
@@ -96,4 +99,6 @@
|
|
return(NIL);}
|
|
|
|
+void init_parser_pratt(void); /* Our sole exported symbol */
|
|
+
|
|
void init_parser_pratt(void)
|
|
{init_subr_3("pratt_read_token",pratt_read_token);
|