| 976 | |
| 977 | |
| 978 | static void body (LexState *ls, expdesc *e, int ismethod, int line) { |
| 979 | /* body -> '(' parlist ')' block END */ |
| 980 | FuncState new_fs; |
| 981 | BlockCnt bl; |
| 982 | new_fs.f = addprototype(ls); |
| 983 | new_fs.f->linedefined = line; |
| 984 | open_func(ls, &new_fs, &bl); |
| 985 | checknext(ls, '('); |
| 986 | if (ismethod) { |
| 987 | new_localvarliteral(ls, "self"); /* create 'self' parameter */ |
| 988 | adjustlocalvars(ls, 1); |
| 989 | } |
| 990 | parlist(ls); |
| 991 | checknext(ls, ')'); |
| 992 | statlist(ls); |
| 993 | new_fs.f->lastlinedefined = ls->linenumber; |
| 994 | check_match(ls, TK_END, TK_FUNCTION, line); |
| 995 | codeclosure(ls, e); |
| 996 | close_func(ls); |
| 997 | } |
| 998 | |
| 999 | |
| 1000 | static int explist (LexState *ls, expdesc *v) { |
no test coverage detected