| 786 | |
| 787 | |
| 788 | static void body (LexState *ls, expdesc *e, int ismethod, int line) { |
| 789 | /* body -> `(' parlist `)' block END */ |
| 790 | FuncState new_fs; |
| 791 | BlockCnt bl; |
| 792 | new_fs.f = addprototype(ls); |
| 793 | new_fs.f->linedefined = line; |
| 794 | open_func(ls, &new_fs, &bl); |
| 795 | checknext(ls, '('); |
| 796 | if (ismethod) { |
| 797 | new_localvarliteral(ls, "self"); /* create 'self' parameter */ |
| 798 | adjustlocalvars(ls, 1); |
| 799 | } |
| 800 | parlist(ls); |
| 801 | checknext(ls, ')'); |
| 802 | statlist(ls); |
| 803 | new_fs.f->lastlinedefined = ls->linenumber; |
| 804 | check_match(ls, TK_END, TK_FUNCTION, line); |
| 805 | codeclosure(ls, e); |
| 806 | close_func(ls); |
| 807 | } |
| 808 | |
| 809 | |
| 810 | static int explist (LexState *ls, expdesc *v) { |
no test coverage detected