I suspect that relaxing this rule would not make the parser much
slower; the simplicity of Lua is intended to help the _human_ parsing
the code. E.g. the famous C/C++ mistake 'if (a = b)' is not possible.
Code is easier to read when there aren't too many possible surprises.
Lets says speed was not much of an issue, then what modifications would be needed to have assignment as an operator in tables.
So if there is say, an __assign() meta-function present in a table, then that is called with the value being assigned.
Also C++ allows references on the left hand side of an assignment statement. So a function which returns a reference can have a value assigned to the returned variable.
If this were present in Lua then having an assignment to the result of a function call would be really easy. Since tables are passed by reference, a function could return the table. Then the assignment operator could be invoked on it.
local tbl = {}
tbl.value = 0
mt = { __assign(value) = function(value) tbl.value = value end}
setmetatable(tbl, mt)
function foo(tbl)
return tbl
end
foo(tbl) = 2
-- tbl.value = 2 now