|
304 | 304 | { |
305 | 305 | "src": "if a:\nx = 1", |
306 | 306 | "constants": ["1"], |
307 | | - "names": ["a_0", "x_1", "x_2"], |
308 | | - "instructions": [["LoadName",0], ["JumpIfFalse",4], ["LoadConst",0], ["StoreName",1], ["Phi",2], ["ReturnValue",0]], |
| 307 | + "names": ["a_0", "x_1", "x_0", "x_2"], |
| 308 | + "instructions": [["LoadName",0], ["JumpIfFalse",4], ["LoadConst",0], ["StoreName",1], ["Phi",3], ["ReturnValue",0]], |
309 | 309 | "annotations": {} |
310 | 310 | }, |
311 | 311 | { |
|
325 | 325 | { |
326 | 326 | "src": "total = 0\nfor i in range(5):\ntotal = total + i", |
327 | 327 | "constants": ["0", "5"], |
328 | | - "names": ["total_1", "i_1", "total_2", "i_2", "total_3"], |
329 | | - "instructions": [["LoadConst",0], ["StoreName",0], ["LoadConst",1], ["CallRange",1], ["GetIter",0], ["ForIter",12], ["StoreName",1], ["LoadName",0], ["LoadName",1], ["Add",0], ["StoreName",2], ["Jump",5], ["Phi",3], ["Phi",4], ["ReturnValue",0]], |
| 328 | + "names": ["total_1", "i_1", "total_2", "i_0", "i_2", "total_3"], |
| 329 | + "instructions": [["LoadConst",0], ["StoreName",0], ["LoadConst",1], ["CallRange",1], ["GetIter",0], ["ForIter",12], ["StoreName",1], ["LoadName",0], ["LoadName",1], ["Add",0], ["StoreName",2], ["Jump",5], ["Phi",4], ["Phi",5], ["ReturnValue",0]], |
330 | 330 | "annotations": {} |
331 | 331 | }, |
332 | 332 | { |
333 | 333 | "src": "for i in range(3):\nprint(i)", |
334 | 334 | "constants": ["3"], |
335 | | - "names": ["i_1", "i_2"], |
336 | | - "instructions": [["LoadConst",0], ["CallRange",1], ["GetIter",0], ["ForIter",8], ["StoreName",0], ["LoadName",0], ["CallPrint",0], ["Jump",3], ["Phi",1], ["ReturnValue",0]], |
| 335 | + "names": ["i_1", "i_0", "i_2"], |
| 336 | + "instructions": [["LoadConst",0], ["CallRange",1], ["GetIter",0], ["ForIter",8], ["StoreName",0], ["LoadName",0], ["CallPrint",0], ["Jump",3], ["Phi",2], ["ReturnValue",0]], |
337 | 337 | "annotations": {} |
338 | 338 | }, |
339 | 339 | { |
|
381 | 381 | { |
382 | 382 | "src": "s = 0\nfor i in range(10):\ns += i", |
383 | 383 | "constants": ["0", "10"], |
384 | | - "names": ["s_1", "i_1", "s_2", "i_2", "s_3"], |
385 | | - "instructions": [["LoadConst",0], ["StoreName",0], ["LoadConst",1], ["CallRange",1], ["GetIter",0], ["ForIter",12], ["StoreName",1], ["LoadName",0], ["LoadName",1], ["Add",0], ["StoreName",2], ["Jump",5], ["Phi",3], ["Phi",4], ["ReturnValue",0]], |
| 384 | + "names": ["s_1", "i_1", "s_2", "i_0", "i_2", "s_3"], |
| 385 | + "instructions": [["LoadConst",0], ["StoreName",0], ["LoadConst",1], ["CallRange",1], ["GetIter",0], ["ForIter",12], ["StoreName",1], ["LoadName",0], ["LoadName",1], ["Add",0], ["StoreName",2], ["Jump",5], ["Phi",4], ["Phi",5], ["ReturnValue",0]], |
386 | 386 | "annotations": {} |
387 | 387 | }, |
388 | 388 | { |
|
423 | 423 | { |
424 | 424 | "src": "if True:\n x = 1\n y = 2\nz = x", |
425 | 425 | "constants": ["1", "2"], |
426 | | - "names": ["x_1", "y_1", "x_2", "y_2", "z_1"], |
427 | | - "instructions": [["LoadTrue",0], ["JumpIfFalse",6], ["LoadConst",0], ["StoreName",0], ["LoadConst",1], ["StoreName",1], ["Phi",2], ["Phi",3], ["LoadName",2], ["StoreName",4], ["ReturnValue",0]], |
| 426 | + "names": ["x_1", "y_1", "x_0", "x_2", "y_0", "y_2", "z_1"], |
| 427 | + "instructions": [["LoadTrue",0], ["JumpIfFalse",6], ["LoadConst",0], ["StoreName",0], ["LoadConst",1], ["StoreName",1], ["Phi",3], ["Phi",5], ["LoadName",3], ["StoreName",6], ["ReturnValue",0]], |
428 | 428 | "annotations": {} |
429 | 429 | }, |
430 | 430 | { |
431 | 431 | "src": "for i in range(3):\n x = i\n print(x)", |
432 | 432 | "constants": ["3"], |
433 | | - "names": ["i_1", "x_1", "i_2", "x_2"], |
434 | | - "instructions": [["LoadConst",0], ["CallRange",1], ["GetIter",0], ["ForIter",10], ["StoreName",0], ["LoadName",0], ["StoreName",1], ["LoadName",1], ["CallPrint",0], ["Jump",3], ["Phi",2], ["Phi",3], ["ReturnValue",0]], |
| 433 | + "names": ["i_1", "x_1", "i_0", "i_2", "x_0", "x_2"], |
| 434 | + "instructions": [["LoadConst",0], ["CallRange",1], ["GetIter",0], ["ForIter",10], ["StoreName",0], ["LoadName",0], ["StoreName",1], ["LoadName",1], ["CallPrint",0], ["Jump",3], ["Phi",3], ["Phi",5], ["ReturnValue",0]], |
435 | 435 | "annotations": {} |
436 | 436 | }, |
437 | 437 | { |
|
521 | 521 | { |
522 | 522 | "src": "try:\n x = 1\nexcept:\n x = 2", |
523 | 523 | "constants": ["1", "2"], |
524 | | - "names": ["x_1", "x_2", "x_3"], |
525 | | - "instructions": [["SetupExcept",5], ["LoadConst",0], ["StoreName",0], ["PopExcept",0], ["Jump",7], ["LoadConst",1], ["StoreName",1], ["Phi",2], ["ReturnValue",0]], |
| 524 | + "names": ["x_1", "x_2", "x_0", "x_3"], |
| 525 | + "instructions": [["SetupExcept",5], ["LoadConst",0], ["StoreName",0], ["PopExcept",0], ["Jump",7], ["LoadConst",1], ["StoreName",1], ["Phi",3], ["ReturnValue",0]], |
526 | 526 | "annotations": {} |
527 | 527 | }, |
528 | 528 | { |
|
939 | 939 | { |
940 | 940 | "src": "for i in range(3):\n pass\nelse:\n x = 1", |
941 | 941 | "constants": ["3", "1"], |
942 | | - "names": ["i_1", "x_1", "i_2", "x_2"], |
943 | | - "instructions": [["LoadConst",0], ["CallRange",1], ["GetIter",0], ["ForIter",6], ["StoreName",0], ["Jump",3], ["LoadConst",1], ["StoreName",1], ["Phi",2], ["Phi",3], ["ReturnValue",0]], |
| 942 | + "names": ["i_1", "x_1", "i_0", "i_2", "x_0", "x_2"], |
| 943 | + "instructions": [["LoadConst",0], ["CallRange",1], ["GetIter",0], ["ForIter",6], ["StoreName",0], ["Jump",3], ["LoadConst",1], ["StoreName",1], ["Phi",3], ["Phi",5], ["ReturnValue",0]], |
944 | 944 | "annotations": {} |
945 | 945 | }, |
946 | 946 | { |
947 | 947 | "src": "while x:\n pass\nelse:\n y = 1", |
948 | 948 | "constants": ["1"], |
949 | | - "names": ["x_0", "y_1", "y_2"], |
950 | | - "instructions": [["LoadName",0], ["JumpIfFalse",3], ["Jump",0], ["LoadConst",0], ["StoreName",1], ["Phi",2], ["ReturnValue",0]], |
| 949 | + "names": ["x_0", "y_1", "y_0", "y_2"], |
| 950 | + "instructions": [["LoadName",0], ["JumpIfFalse",3], ["Jump",0], ["LoadConst",0], ["StoreName",1], ["Phi",3], ["ReturnValue",0]], |
951 | 951 | "annotations": {} |
952 | 952 | }, |
953 | 953 | { |
954 | | - "src": "try:\n x = 1\nexcept:\n x = 2\nelse:\n x = 3", |
955 | | - "constants": ["1", "2", "3"], |
956 | | - "names": ["x_1", "x_2", "x_3", "x_4"], |
957 | | - "instructions": [["SetupExcept",5], ["LoadConst",0], ["StoreName",0], ["PopExcept",0], ["Jump",7], ["LoadConst",1], ["StoreName",1], ["LoadConst",2], ["StoreName",2], ["Phi",3], ["ReturnValue",0]], |
| 954 | + "src": "try:\n x = 1\nexcept:\n x = 2\nelse:\n x = 3", "constants": ["1", "2", "3"], "names": ["x_1", "x_2", "x_3", "x_0", "x_4"], |
| 955 | + "instructions": [["SetupExcept",5], ["LoadConst",0], ["StoreName",0], ["PopExcept",0], ["Jump",7], ["LoadConst",1], ["StoreName",1], ["LoadConst",2], ["StoreName",2], ["Phi",4], ["ReturnValue",0]], |
958 | 956 | "annotations": {} |
959 | 957 | }, |
960 | 958 | { |
|
0 commit comments