| 833 | |
| 834 | |
| 835 | static void recfield (LexState *ls, ConsControl *cc) { |
| 836 | /* recfield -> (NAME | '['exp']') = exp */ |
| 837 | FuncState *fs = ls->fs; |
| 838 | int reg = ls->fs->freereg; |
| 839 | expdesc tab, key, val; |
| 840 | if (ls->t.token == TK_NAME) { |
| 841 | checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); |
| 842 | codename(ls, &key); |
| 843 | } |
| 844 | else /* ls->t.token == '[' */ |
| 845 | yindex(ls, &key); |
| 846 | cc->nh++; |
| 847 | checknext(ls, '='); |
| 848 | tab = *cc->t; |
| 849 | luaK_indexed(fs, &tab, &key); |
| 850 | expr(ls, &val); |
| 851 | luaK_storevar(fs, &tab, &val); |
| 852 | fs->freereg = reg; /* free registers */ |
| 853 | } |
| 854 | |
| 855 | |
| 856 | static void closelistfield (FuncState *fs, ConsControl *cc) { |
no test coverage detected