| 1913 | |
| 1914 | |
| 1915 | static void globalnames (LexState *ls, lu_byte defkind) { |
| 1916 | FuncState *fs = ls->fs; |
| 1917 | int nvars = 0; |
| 1918 | int lastidx; /* index of last registered variable */ |
| 1919 | do { /* for each name */ |
| 1920 | TString *vname = str_checkname(ls); |
| 1921 | lu_byte kind = getglobalattribute(ls, defkind); |
| 1922 | lastidx = new_varkind(ls, vname, kind); |
| 1923 | nvars++; |
| 1924 | } while (testnext(ls, ',')); |
| 1925 | if (testnext(ls, '=')) /* initialization? */ |
| 1926 | initglobal(ls, nvars, lastidx - nvars + 1, 0, ls->linenumber); |
| 1927 | fs->nactvar = cast_short(fs->nactvar + nvars); /* activate declaration */ |
| 1928 | } |
| 1929 | |
| 1930 | |
| 1931 | static void globalstat (LexState *ls) { |
no test coverage detected