From 72f67fa810715220c1134a345903146569417190 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 22 Dec 1993 19:15:16 -0200 Subject: [PATCH] eliminacao da funcao findenclosedconstant, cuja tarefa agora e' realizada pelo analizador lexico --- table.c | 53 +---------------------------------------------------- table.h | 3 +-- 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/table.c b/table.c index 8b425e2f..62ad696a 100644 --- a/table.c +++ b/table.c @@ -3,7 +3,7 @@ ** Module to control static tables */ -char *rcs_table="$Id: $"; +char *rcs_table="$Id: table.c,v 1.1 1993/12/17 18:41:19 celes Exp roberto $"; #include #include @@ -115,57 +115,6 @@ int lua_findsymbol (char *s) return lua_ntable++; } -/* -** Given a constant string, eliminate its delimeters (" or '), search it at -** constant table and return its index. If not found, allocate at end of -** the table, checking oveflow and return its index. -** -** For each allocation, the function allocate a extra char to be used to -** mark used string (it's necessary to deal with constant and string -** uniformily). The function store at the table the second position allocated, -** that represents the beginning of the real string. On error, return -1. -** -*/ -int lua_findenclosedconstant (char *s) -{ - int i, j, l=strlen(s); - char *c = calloc (l, sizeof(char)); /* make a copy */ - - c++; /* create mark space */ - - /* introduce scape characters */ - for (i=1,j=0; i= MAXCONSTANT-1) - { - lua_error ("lua: constant string table overflow"); - return -1; - } - lua_constant[lua_nconstant++] = c; - return (lua_nconstant-1); -} - /* ** Given a constant string, search it at constant table and return its index. ** If not found, allocate at end of the table, checking oveflow and return diff --git a/table.h b/table.h index 1941fb28..ca246dc6 100644 --- a/table.h +++ b/table.h @@ -1,7 +1,7 @@ /* ** Module to control static tables ** TeCGraf - PUC-Rio -** $Id: $ +** $Id: table.h,v 1.1 1993/12/17 18:41:19 celes Exp roberto $ */ #ifndef table_h @@ -26,7 +26,6 @@ extern int lua_nfile; int lua_findsymbol (char *s); -int lua_findenclosedconstant (char *s); int lua_findconstant (char *s); void lua_markobject (Object *o); char *lua_createstring (char *s);