aboutsummaryrefslogtreecommitdiff
path: root/lua.stx
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-01 16:25:20 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-01 16:25:20 -0200
commitf53460aab94c64879624c72222e282fe492122ae (patch)
tree9844b4e8b71da8034f976159dc83714c5bdcefde /lua.stx
parent41e4c5798ee95404f6687def4bbed236566db676 (diff)
downloadlua-f53460aab94c64879624c72222e282fe492122ae.tar.gz
lua-f53460aab94c64879624c72222e282fe492122ae.tar.bz2
lua-f53460aab94c64879624c72222e282fe492122ae.zip
CREATEARRAY now has an argument, the size of the array to create.
Diffstat (limited to 'lua.stx')
-rw-r--r--lua.stx16
1 files changed, 11 insertions, 5 deletions
diff --git a/lua.stx b/lua.stx
index 75971a45..ceed9c4b 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
1%{ 1%{
2 2
3char *rcs_luastx = "$Id: lua.stx,v 2.10 1994/10/17 19:05:32 celes Exp roberto $"; 3char *rcs_luastx = "$Id: lua.stx,v 2.11 1994/10/21 19:00:12 roberto Exp roberto $";
4 4
5#include <stdio.h> 5#include <stdio.h>
6#include <stdlib.h> 6#include <stdlib.h>
@@ -528,10 +528,8 @@ expr : '(' expr ')' { $$ = $2; }
528 528
529table : 529table :
530 { 530 {
531 code_byte(PUSHWORD);
532 $<vLong>$ = pc; code_word(0);
533 incr_ntemp();
534 code_byte(CREATEARRAY); 531 code_byte(CREATEARRAY);
532 $<vLong>$ = pc; code_word(0);
535 } 533 }
536 '{' fieldlist '}' 534 '{' fieldlist '}'
537 { 535 {
@@ -918,7 +916,15 @@ static void PrintCode (Byte *code, Byte *end)
918 printf ("%d ADJUST %d\n", p-code, *(++p)); 916 printf ("%d ADJUST %d\n", p-code, *(++p));
919 p++; 917 p++;
920 break; 918 break;
921 case CREATEARRAY: printf ("%d CREATEARRAY\n", (p++)-code); break; 919 case CREATEARRAY:
920 {
921 CodeWord c;
922 int n = p-code;
923 p++;
924 get_word(c,p);
925 printf ("%d CREATEARRAY\n", n, c.w);
926 break;
927 }
922 case EQOP: printf ("%d EQOP\n", (p++)-code); break; 928 case EQOP: printf ("%d EQOP\n", (p++)-code); break;
923 case LTOP: printf ("%d LTOP\n", (p++)-code); break; 929 case LTOP: printf ("%d LTOP\n", (p++)-code); break;
924 case LEOP: printf ("%d LEOP\n", (p++)-code); break; 930 case LEOP: printf ("%d LEOP\n", (p++)-code); break;