[ { "Label": "function_expression", "Input": "local add = function(a, b) print(a + b) end", "AST": { "Type": "Block", "Range": { "Start": 0, "End": 43 }, "Stmts": [ { "Type": "LocalStatement", "Range": { "Start": 0, "End": 43 }, "Names": [ { "Type": "Identifier", "Range": { "Start": 6, "End": 9 }, "Literal": "add" } ], "Exps": [ { "Type": "FunctionExpression", "Range": { "Start": 12, "End": 43 }, "Params": [ { "Type": "Identifier", "Range": { "Start": 21, "End": 22 }, "Literal": "a" }, { "Type": "Identifier", "Range": { "Start": 24, "End": 25 }, "Literal": "b" } ], "Vararg": false, "Body": { "Type": "Block", "Range": { "Start": 27, "End": 39 }, "Stmts": [ { "Type": "FunctionCall", "Range": { "Start": 27, "End": 39 }, "Left": { "Type": "Identifier", "Range": { "Start": 27, "End": 32 }, "Literal": "print" }, "Args": [ { "Type": "InfixExpression", "Range": { "Start": 33, "End": 38 }, "Left": { "Type": "Identifier", "Range": { "Start": 33, "End": 34 }, "Literal": "a" }, "Operator": "plus", "Right": { "Type": "Identifier", "Range": { "Start": 37, "End": 38 }, "Literal": "b" } } ] } ] } } ] } ] } }, { "Label": "function_statement", "Input": "function add(a, b) print(a + b) end", "AST": { "Type": "Block", "Range": { "Start": 0, "End": 35 }, "Stmts": [ { "Type": "FunctionStatement", "Range": { "Start": 0, "End": 35 }, "Left": { "Type": "Identifier", "Range": { "Start": 9, "End": 12 }, "Literal": "add" }, "Params": [ { "Type": "Identifier", "Range": { "Start": 13, "End": 14 }, "Literal": "a" }, { "Type": "Identifier", "Range": { "Start": 16, "End": 17 }, "Literal": "b" } ], "Vararg": false, "Body": { "Type": "Block", "Range": { "Start": 19, "End": 31 }, "Stmts": [ { "Type": "FunctionCall", "Range": { "Start": 19, "End": 31 }, "Left": { "Type": "Identifier", "Range": { "Start": 19, "End": 24 }, "Literal": "print" }, "Args": [ { "Type": "InfixExpression", "Range": { "Start": 25, "End": 30 }, "Left": { "Type": "Identifier", "Range": { "Start": 25, "End": 26 }, "Literal": "a" }, "Operator": "plus", "Right": { "Type": "Identifier", "Range": { "Start": 29, "End": 30 }, "Literal": "b" } } ] } ] }, "IsLocal": false } ] } } ]