diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-15 11:31:49 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-15 11:31:49 -0300 |
| commit | 17e0c29d9b435392016b707309ed51409b0aea12 (patch) | |
| tree | c7178cf68fac2f1f9c3b22ce50be29b67f416cc0 /testes/coroutine.lua | |
| parent | 8eb0abc9db4d47db5192bed18565e3d1aa53566d (diff) | |
| download | lua-17e0c29d9b435392016b707309ed51409b0aea12.tar.gz lua-17e0c29d9b435392016b707309ed51409b0aea12.tar.bz2 lua-17e0c29d9b435392016b707309ed51409b0aea12.zip | |
Clear interface between references and predefines
The reference system has a defined way to add initial values to the
table where it operates.
Diffstat (limited to 'testes/coroutine.lua')
| -rw-r--r-- | testes/coroutine.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 990da8c4..6c15db03 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
| @@ -681,7 +681,7 @@ else | |||
| 681 | c == "ERRRUN" and d == 4) | 681 | c == "ERRRUN" and d == 4) |
| 682 | 682 | ||
| 683 | a, b, c, d = T.testC([[ | 683 | a, b, c, d = T.testC([[ |
| 684 | rawgeti R 1 # get main thread | 684 | rawgeti R !M # get main thread |
| 685 | pushnum 10; | 685 | pushnum 10; |
| 686 | pushnum 20; | 686 | pushnum 20; |
| 687 | resume -3 2; | 687 | resume -3 2; |
| @@ -699,7 +699,7 @@ else | |||
| 699 | assert(T.testC(state, "newthread; isyieldable -1; remove 1; return 1")) | 699 | assert(T.testC(state, "newthread; isyieldable -1; remove 1; return 1")) |
| 700 | 700 | ||
| 701 | -- main thread is not yieldable | 701 | -- main thread is not yieldable |
| 702 | assert(not T.testC(state, "rawgeti R 1; isyieldable -1; remove 1; return 1")) | 702 | assert(not T.testC(state, "rawgeti R !M; isyieldable -1; remove 1; return 1")) |
| 703 | 703 | ||
| 704 | T.testC(state, "settop 0") | 704 | T.testC(state, "settop 0") |
| 705 | 705 | ||
| @@ -711,7 +711,7 @@ else | |||
| 711 | return 'ok']])) | 711 | return 'ok']])) |
| 712 | 712 | ||
| 713 | local t = table.pack(T.testC(state, [[ | 713 | local t = table.pack(T.testC(state, [[ |
| 714 | rawgeti R 1 # get main thread | 714 | rawgeti R !M # get main thread |
| 715 | pushstring 'XX' | 715 | pushstring 'XX' |
| 716 | getglobal X # get function for body | 716 | getglobal X # get function for body |
| 717 | pushstring AA # arg | 717 | pushstring AA # arg |
| @@ -720,7 +720,7 @@ else | |||
| 720 | setglobal T # top | 720 | setglobal T # top |
| 721 | setglobal B # second yielded value | 721 | setglobal B # second yielded value |
| 722 | setglobal A # fist yielded value | 722 | setglobal A # fist yielded value |
| 723 | rawgeti R 1 # get main thread | 723 | rawgeti R !M # get main thread |
| 724 | pushnum 5 # arg (noise) | 724 | pushnum 5 # arg (noise) |
| 725 | resume 1 1 # after coroutine ends, previous stack is back | 725 | resume 1 1 # after coroutine ends, previous stack is back |
| 726 | pushstatus | 726 | pushstatus |
