diff options
author | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-08-03 11:15:46 -0300 |
---|---|---|
committer | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-08-03 11:15:46 -0300 |
commit | b1e9b37883ebc3f9926f6693350a73d6cbb94b6e (patch) | |
tree | 600f3e33d0dd976b0c2d6c86489f22ebcd129301 /lua.stx | |
parent | 467288e5b35d6f264bdded9b4d09dbaa0597f967 (diff) | |
download | lua-b1e9b37883ebc3f9926f6693350a73d6cbb94b6e.tar.gz lua-b1e9b37883ebc3f9926f6693350a73d6cbb94b6e.tar.bz2 lua-b1e9b37883ebc3f9926f6693350a73d6cbb94b6e.zip |
Implementacao de funcoes para tratar Lua function em C e
correcoes de bugs nas tabelas dinamicas.
Diffstat (limited to 'lua.stx')
-rw-r--r-- | lua.stx | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,6 +1,6 @@ | |||
1 | %{ | 1 | %{ |
2 | 2 | ||
3 | char *rcs_luastx = "$Id: lua.stx,v 2.4 1994/04/20 16:22:21 celes Exp celes $"; | 3 | char *rcs_luastx = "$Id: lua.stx,v 2.5 1994/07/19 21:27:18 celes Exp $"; |
4 | 4 | ||
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
@@ -113,10 +113,16 @@ static void flush_list (int m, int n) | |||
113 | if (m == 0) | 113 | if (m == 0) |
114 | code_byte(STORELIST0); | 114 | code_byte(STORELIST0); |
115 | else | 115 | else |
116 | if (m < 255) | ||
116 | { | 117 | { |
117 | code_byte(STORELIST); | 118 | code_byte(STORELIST); |
118 | code_byte(m); | 119 | code_byte(m); |
119 | } | 120 | } |
121 | else | ||
122 | { | ||
123 | lua_error ("list constructor too long"); | ||
124 | err = 1; | ||
125 | } | ||
120 | code_byte(n); | 126 | code_byte(n); |
121 | ntemp-=n; | 127 | ntemp-=n; |
122 | } | 128 | } |
@@ -459,14 +465,14 @@ expr : '(' expr ')' { $$ = $2; } | |||
459 | 465 | ||
460 | typeconstructor: '@' | 466 | typeconstructor: '@' |
461 | { | 467 | { |
462 | code_byte(PUSHBYTE); | 468 | code_byte(PUSHWORD); |
463 | $<vLong>$ = pc; code_byte(0); | 469 | $<vLong>$ = pc; code_word(0); |
464 | incr_ntemp(); | 470 | incr_ntemp(); |
465 | code_byte(CREATEARRAY); | 471 | code_byte(CREATEARRAY); |
466 | } | 472 | } |
467 | objectname fieldlist | 473 | objectname fieldlist |
468 | { | 474 | { |
469 | basepc[$<vLong>2] = $4; | 475 | code_word_at(basepc+$<vLong>2, $4); |
470 | if ($3 < 0) /* there is no function to be called */ | 476 | if ($3 < 0) /* there is no function to be called */ |
471 | { | 477 | { |
472 | $$ = 1; | 478 | $$ = 1; |