Commit ef5440f
committed
Issue yuin#514 : Fix compileRegAssignment cardinality
Use `nvars` as the assignment numbers rather than `lennames`.
This makes no difference in `compileLocalAssignStmt` as the numbers are
equal, but in `compileGenericForStmt` the names are the iteration
variables while `nvars` refers to the local generator, state, and
control. The iteration variables feel a bit out of place here.
The whole body of `compileRegAssignment` seem inconsistent, using
`names` only for its length, and mixing `lennames` and `nvars` in
surprising ways.
Moreover the function name `compileRegAssignment` suggests assigning to
registers rather than names, so I dropped `lennames` entirely to use
only `nvars`.1 parent ccacf66 commit ef5440f
2 files changed
+27
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | | - | |
816 | | - | |
| 815 | + | |
817 | 816 | | |
818 | 817 | | |
819 | 818 | | |
820 | 819 | | |
821 | | - | |
| 820 | + | |
822 | 821 | | |
823 | 822 | | |
824 | 823 | | |
825 | 824 | | |
826 | 825 | | |
827 | 826 | | |
828 | | - | |
| 827 | + | |
829 | 828 | | |
830 | 829 | | |
831 | 830 | | |
| |||
835 | 834 | | |
836 | 835 | | |
837 | 836 | | |
838 | | - | |
839 | | - | |
| 837 | + | |
| 838 | + | |
840 | 839 | | |
841 | 840 | | |
842 | 841 | | |
| |||
857 | 856 | | |
858 | 857 | | |
859 | 858 | | |
860 | | - | |
| 859 | + | |
861 | 860 | | |
862 | 861 | | |
863 | 862 | | |
864 | 863 | | |
865 | | - | |
| 864 | + | |
866 | 865 | | |
867 | 866 | | |
868 | 867 | | |
| |||
1100 | 1099 | | |
1101 | 1100 | | |
1102 | 1101 | | |
1103 | | - | |
| 1102 | + | |
1104 | 1103 | | |
1105 | 1104 | | |
1106 | 1105 | | |
| |||
0 commit comments