new form for constructors: {[exp] = exp, ...}

This commit is contained in:
Roberto Ierusalimschy
1997-03-06 14:30:55 -03:00
parent c3c0b52a1f
commit b8af9c56c9
3 changed files with 38 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
char *rcs_opcode="$Id: opcode.c,v 3.81 1997/02/20 15:51:14 roberto Exp roberto $";
char *rcs_opcode="$Id: opcode.c,v 3.82 1997/02/26 17:38:41 roberto Unstable roberto $";
#include <setjmp.h>
#include <stdio.h>
@@ -1184,7 +1184,7 @@ static StkId lua_execute (Byte *pc, StkId base)
}
break;
case STORERECORD:
case STORERECORD: /* opcode obsolete: supersed by STOREMAP */
{
int n = *(pc++);
Object *arr = top-n-1;
@@ -1200,6 +1200,16 @@ static StkId lua_execute (Byte *pc, StkId base)
}
break;
case STOREMAP: {
int n = *(pc++);
Object *arr = top-(2*n)-1;
while (n--) {
*(lua_hashdefine (avalue(arr), top-2)) = *(top-1);
top-=2;
}
}
break;
case ADJUST0:
adjust_top(base);
break;