| 988 | |
| 989 | |
| 990 | static void body (LexState *ls, expdesc *e, int ismethod, int line) { |
| 991 | /* body -> '(' parlist ')' block END */ |
| 992 | FuncState new_fs; |
| 993 | BlockCnt bl; |
| 994 | new_fs.f = addprototype(ls); |
| 995 | new_fs.f->linedefined = line; |
| 996 | open_func(ls, &new_fs, &bl); |
| 997 | checknext(ls, '('); |
| 998 | if (ismethod) { |
| 999 | new_localvarliteral(ls, "self"); /* create 'self' parameter */ |
| 1000 | adjustlocalvars(ls, 1); |
| 1001 | } |
| 1002 | parlist(ls); |
| 1003 | checknext(ls, ')'); |
| 1004 | statlist(ls); |
| 1005 | new_fs.f->lastlinedefined = ls->linenumber; |
| 1006 | check_match(ls, TK_END, TK_FUNCTION, line); |
| 1007 | codeclosure(ls, e); |
| 1008 | close_func(ls); |
| 1009 | } |
| 1010 | |
| 1011 | |
| 1012 | static int explist (LexState *ls, expdesc *v) { |
no test coverage detected