| 845 | |
| 846 | |
| 847 | static void recfield (LexState *ls, ConsControl *cc) { |
| 848 | /* recfield -> (NAME | '['exp']') = exp */ |
| 849 | FuncState *fs = ls->fs; |
| 850 | int reg = ls->fs->freereg; |
| 851 | expdesc tab, key, val; |
| 852 | if (ls->t.token == TK_NAME) { |
| 853 | checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); |
| 854 | codename(ls, &key); |
| 855 | } |
| 856 | else /* ls->t.token == '[' */ |
| 857 | yindex(ls, &key); |
| 858 | cc->nh++; |
| 859 | checknext(ls, '='); |
| 860 | tab = *cc->t; |
| 861 | luaK_indexed(fs, &tab, &key); |
| 862 | expr(ls, &val); |
| 863 | luaK_storevar(fs, &tab, &val); |
| 864 | fs->freereg = reg; /* free registers */ |
| 865 | } |
| 866 | |
| 867 | |
| 868 | static void closelistfield (FuncState *fs, ConsControl *cc) { |
no test coverage detected