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

Function primaryexp

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

Source from the content-addressed store, hash-verified

692
693
694static void primaryexp (LexState *ls, expdesc *v) {
695 /* primaryexp ->
696 prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */
697 FuncState *fs = ls->fs;
698 prefixexp(ls, v);
699 for (;;) {
700 switch (ls->t.token) {
701 case '.': { /* field */
702 field(ls, v);
703 break;
704 }
705 case '[': { /* `[' exp1 `]' */
706 expdesc key;
707 luaK_exp2anyreg(fs, v);
708 yindex(ls, &key);
709 luaK_indexed(fs, v, &key);
710 break;
711 }
712 case ':': { /* `:' NAME funcargs */
713 expdesc key;
714 luaX_next(ls);
715 checkname(ls, &key);
716 luaK_self(fs, v, &key);
717 funcargs(ls, v);
718 break;
719 }
720 case '(': case TK_STRING: case '{': { /* funcargs */
721 luaK_exp2nextreg(fs, v);
722 funcargs(ls, v);
723 break;
724 }
725 default: return;
726 }
727 }
728}
729
730
731static void simpleexp (LexState *ls, expdesc *v) {

Callers 3

simpleexpFunction · 0.70
assignmentFunction · 0.70
exprstatFunction · 0.70

Calls 10

prefixexpFunction · 0.85
fieldFunction · 0.70
luaK_exp2anyregFunction · 0.70
yindexFunction · 0.70
luaK_indexedFunction · 0.70
luaX_nextFunction · 0.70
checknameFunction · 0.70
luaK_selfFunction · 0.70
funcargsFunction · 0.70
luaK_exp2nextregFunction · 0.70

Tested by

no test coverage detected