MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / primaryexp

Function primaryexp

Source/Misc/lua/src/lua.c:8266–8300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8264
8265
8266static void primaryexp (LexState *ls, expdesc *v) {
8267/* primaryexp ->
8268prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */
8269FuncState *fs = ls->fs;
8270prefixexp(ls, v);
8271for (;;) {
8272switch (ls->t.token) {
8273case '.': { /* field */
8274field(ls, v);
8275break;
8276}
8277case '[': { /* `[' exp1 `]' */
8278expdesc key;
8279luaK_exp2anyreg(fs, v);
8280yindex(ls, &key);
8281luaK_indexed(fs, v, &key);
8282break;
8283}
8284case ':': { /* `:' NAME funcargs */
8285expdesc key;
8286luaX_next(ls);
8287checkname(ls, &key);
8288luaK_self(fs, v, &key);
8289funcargs(ls, v);
8290break;
8291}
8292case '(': case TK_STRING: case '{': { /* funcargs */
8293luaK_exp2nextreg(fs, v);
8294funcargs(ls, v);
8295break;
8296}
8297default: return;
8298}
8299}
8300}
8301
8302
8303static void simpleexp (LexState *ls, expdesc *v) {

Callers 3

simpleexpFunction · 0.85
assignmentFunction · 0.85
exprstatFunction · 0.85

Calls 10

prefixexpFunction · 0.85
fieldFunction · 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

Tested by

no test coverage detected