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