nagydani / loveputer

A console-based Lua-programmable computer for children based on löve2d framework.
GNU General Public License v3.0
3 stars 2 forks source link

function syntax sugar local/global discrepancy #46

Open aldum opened 4 months ago

aldum commented 4 months ago

In this case, the parser remembers, which form was used:

local function x() end
--- vs
local x = function() end

However, these:

function x() end
--- vs
x = function() end

get parsed into almost the same AST, making it nigh impossible to discern on the other side.

TODO: check what logic is used in one case and not in the other in the parser.

nagydani commented 2 months ago

For now, let's keep it as is (syntactic sugar automatically applied in the global case), review later. Not scheduled for any sprint.