| 1101 | |
| 1102 | |
| 1103 | static void body (LexState *ls, expdesc *e, int ismethod, int line) { |
| 1104 | /* body -> '(' parlist ')' block END */ |
| 1105 | FuncState new_fs; |
| 1106 | BlockCnt bl; |
| 1107 | new_fs.f = addprototype(ls); |
| 1108 | new_fs.f->linedefined = line; |
| 1109 | open_func(ls, &new_fs, &bl); |
| 1110 | checknext(ls, '('); |
| 1111 | if (ismethod) { |
| 1112 | new_localvarliteral(ls, "self"); /* create 'self' parameter */ |
| 1113 | adjustlocalvars(ls, 1); |
| 1114 | } |
| 1115 | parlist(ls); |
| 1116 | checknext(ls, ')'); |
| 1117 | statlist(ls); |
| 1118 | new_fs.f->lastlinedefined = ls->linenumber; |
| 1119 | check_match(ls, TK_END, TK_FUNCTION, line); |
| 1120 | codeclosure(ls, e); |
| 1121 | close_func(ls); |
| 1122 | } |
| 1123 | |
| 1124 | |
| 1125 | static int explist (LexState *ls, expdesc *v) { |
no test coverage detected