MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / primaryexp

Function primaryexp

lua/lparser.c:729–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727
728
729static void primaryexp (LexState *ls, expdesc *v) {
730 /* primaryexp ->
731 prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */
732 FuncState *fs = ls->fs;
733 prefixexp(ls, v);
734 for (;;) {
735 switch (ls->t.token) {
736 case '.': { /* field */
737 field(ls, v);
738 break;
739 }
740 case '[': { /* `[' exp1 `]' */
741 expdesc key;
742 luaK_exp2anyreg(fs, v);
743 yindex(ls, &key);
744 luaK_indexed(fs, v, &key);
745 break;
746 }
747 case ':': { /* `:' NAME funcargs */
748 expdesc key;
749 luaX_next(ls);
750 checkname(ls, &key);
751 luaK_self(fs, v, &key);
752 funcargs(ls, v);
753 break;
754 }
755 case '(': case TK_STRING: case '{': { /* funcargs */
756 luaK_exp2nextreg(fs, v);
757 funcargs(ls, v);
758 break;
759 }
760 default: return;
761 }
762 }
763}
764
765
766static void simpleexp (LexState *ls, expdesc *v) {

Callers 3

simpleexpFunction · 0.85
assignmentFunction · 0.85
exprstatFunction · 0.85

Calls 10

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

Tested by

no test coverage detected