aboutsummaryrefslogtreecommitdiff
path: root/lua.stx
diff options
context:
space:
mode:
Diffstat (limited to 'lua.stx')
-rw-r--r--lua.stx22
1 files changed, 11 insertions, 11 deletions
diff --git a/lua.stx b/lua.stx
index 92e7f6b8..177e60ed 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
1%{ 1%{
2 2
3char *rcs_luastx = "$Id: lua.stx,v 3.3 1994/11/06 15:35:04 roberto Exp roberto $"; 3char *rcs_luastx = "$Id: lua.stx,v 3.4 1994/11/09 18:07:38 roberto Exp roberto $";
4 4
5#include <stdio.h> 5#include <stdio.h>
6#include <stdlib.h> 6#include <stdlib.h>
@@ -22,7 +22,7 @@ char *rcs_luastx = "$Id: lua.stx,v 3.3 1994/11/06 15:35:04 roberto Exp roberto $
22static Long maxcode; 22static Long maxcode;
23static Long maxmain; 23static Long maxmain;
24static Long maxcurr ; 24static Long maxcurr ;
25static Byte *code = NULL; 25static Byte *funcCode = NULL;
26static Byte **initcode; 26static Byte **initcode;
27static Byte *basepc; 27static Byte *basepc;
28static Long maincode; 28static Long maincode;
@@ -166,10 +166,10 @@ static void code_number (float f)
166 166
167static void init_function (void) 167static void init_function (void)
168{ 168{
169 if (code == NULL) /* first function */ 169 if (funcCode == NULL) /* first function */
170 { 170 {
171 code = (Byte *) calloc(CODE_BLOCK, sizeof(Byte)); 171 funcCode = (Byte *) calloc(CODE_BLOCK, sizeof(Byte));
172 if (code == NULL) 172 if (funcCode == NULL)
173 lua_error("not enough memory"); 173 lua_error("not enough memory");
174 maxcode = CODE_BLOCK; 174 maxcode = CODE_BLOCK;
175 } 175 }
@@ -240,7 +240,7 @@ functionlist : /* empty */
240function : FUNCTION NAME 240function : FUNCTION NAME
241 { 241 {
242 init_function(); 242 init_function();
243 pc=0; basepc=code; maxcurr=maxcode; 243 pc=0; basepc=funcCode; maxcurr=maxcode;
244 nlocalvar=0; 244 nlocalvar=0;
245 $<vWord>$ = lua_findsymbol($2); 245 $<vWord>$ = lua_findsymbol($2);
246 } 246 }
@@ -263,9 +263,9 @@ function : FUNCTION NAME
263 if (s_bvalue($<vWord>3) == NULL) 263 if (s_bvalue($<vWord>3) == NULL)
264 lua_error("not enough memory"); 264 lua_error("not enough memory");
265 memcpy (s_bvalue($<vWord>3), basepc, pc*sizeof(Byte)); 265 memcpy (s_bvalue($<vWord>3), basepc, pc*sizeof(Byte));
266 code = basepc; maxcode=maxcurr; 266 funcCode = basepc; maxcode=maxcurr;
267#if LISTING 267#if LISTING
268 PrintCode(code,code+pc); 268 PrintCode(funcCode,funcCode+pc);
269#endif 269#endif
270 } 270 }
271 ; 271 ;
@@ -273,7 +273,7 @@ function : FUNCTION NAME
273method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME 273method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME
274 { 274 {
275 init_function(); 275 init_function();
276 pc=0; basepc=code; maxcurr=maxcode; 276 pc=0; basepc=funcCode; maxcurr=maxcode;
277 nlocalvar=0; 277 nlocalvar=0;
278 localvar[nlocalvar]=lua_findsymbol("self"); /* self param. */ 278 localvar[nlocalvar]=lua_findsymbol("self"); /* self param. */
279 add_nlocalvar(1); 279 add_nlocalvar(1);
@@ -298,9 +298,9 @@ method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME
298 if (b == NULL) 298 if (b == NULL)
299 lua_error("not enough memory"); 299 lua_error("not enough memory");
300 memcpy (b, basepc, pc*sizeof(Byte)); 300 memcpy (b, basepc, pc*sizeof(Byte));
301 code = basepc; maxcode=maxcurr; 301 funcCode = basepc; maxcode=maxcurr;
302#if LISTING 302#if LISTING
303 PrintCode(code,code+pc); 303 PrintCode(funcCode,funcCode+pc);
304#endif 304#endif
305 /* assign function to table field */ 305 /* assign function to table field */
306 pc=maincode; basepc=*initcode; maxcurr=maxmain; 306 pc=maincode; basepc=*initcode; maxcurr=maxmain;