MCPcopy Create free account
hub / github.com/F-Stack/f-stack / statement

Function statement

app/redis-6.2.6/deps/lua/src/lparser.c:1275–1326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1273
1274
1275static int statement (LexState *ls) {
1276 int line = ls->linenumber; /* may be needed for error messages */
1277 switch (ls->t.token) {
1278 case TK_IF: { /* stat -> ifstat */
1279 ifstat(ls, line);
1280 return 0;
1281 }
1282 case TK_WHILE: { /* stat -> whilestat */
1283 whilestat(ls, line);
1284 return 0;
1285 }
1286 case TK_DO: { /* stat -> DO block END */
1287 luaX_next(ls); /* skip DO */
1288 block(ls);
1289 check_match(ls, TK_END, TK_DO, line);
1290 return 0;
1291 }
1292 case TK_FOR: { /* stat -> forstat */
1293 forstat(ls, line);
1294 return 0;
1295 }
1296 case TK_REPEAT: { /* stat -> repeatstat */
1297 repeatstat(ls, line);
1298 return 0;
1299 }
1300 case TK_FUNCTION: {
1301 funcstat(ls, line); /* stat -> funcstat */
1302 return 0;
1303 }
1304 case TK_LOCAL: { /* stat -> localstat */
1305 luaX_next(ls); /* skip LOCAL */
1306 if (testnext(ls, TK_FUNCTION)) /* local function? */
1307 localfunc(ls);
1308 else
1309 localstat(ls);
1310 return 0;
1311 }
1312 case TK_RETURN: { /* stat -> retstat */
1313 retstat(ls);
1314 return 1; /* must be last statement */
1315 }
1316 case TK_BREAK: { /* stat -> breakstat */
1317 luaX_next(ls); /* skip BREAK */
1318 breakstat(ls);
1319 return 1; /* must be last statement */
1320 }
1321 default: {
1322 exprstat(ls);
1323 return 0; /* to avoid warnings */
1324 }
1325 }
1326}
1327
1328
1329static void chunk (LexState *ls) {

Callers 1

chunkFunction · 0.70

Calls 14

breakstatFunction · 0.85
ifstatFunction · 0.70
whilestatFunction · 0.70
luaX_nextFunction · 0.70
blockFunction · 0.70
check_matchFunction · 0.70
forstatFunction · 0.70
repeatstatFunction · 0.70
funcstatFunction · 0.70
testnextFunction · 0.70
localfuncFunction · 0.70
localstatFunction · 0.70

Tested by

no test coverage detected