MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / primaryexp

Function primaryexp

other_src/lua/src/lparser.cpp:690–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

simpleexpFunction · 0.70
assignmentFunction · 0.70
exprstatFunction · 0.70

Calls 10

prefixexpFunction · 0.70
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