[ { "Label": "repeat", "Input": "local i = 0 repeat i = i + 1 until i == 50 print('done')", "AST": { "Type": "Block", "Range": { "Start": 0, "End": 56 }, "Stmts": [ { "Type": "LocalStatement", "Range": { "Start": 0, "End": 11 }, "Names": [ { "Type": "Identifier", "Range": { "Start": 6, "End": 7 }, "Literal": "i" } ], "Exps": [ { "Type": "NumberLiteral", "Range": { "Start": 10, "End": 11 }, "Literal": "0", "Value": 0 } ] }, { "Type": "RepeatStatement", "Range": { "Start": 12, "End": 42 }, "Body": { "Type": "Block", "Range": { "Start": 19, "End": 28 }, "Stmts": [ { "Type": "AssignmentStatement", "Range": { "Start": 19, "End": 28 }, "Vars": [ { "Type": "Identifier", "Range": { "Start": 19, "End": 20 }, "Literal": "i" } ], "Exps": [ { "Type": "InfixExpression", "Range": { "Start": 23, "End": 28 }, "Left": { "Type": "Identifier", "Range": { "Start": 23, "End": 24 }, "Literal": "i" }, "Operator": "plus", "Right": { "Type": "NumberLiteral", "Range": { "Start": 27, "End": 28 }, "Literal": "1", "Value": 1 } } ] } ] }, "Condition": { "Type": "InfixExpression", "Range": { "Start": 35, "End": 42 }, "Left": { "Type": "Identifier", "Range": { "Start": 35, "End": 36 }, "Literal": "i" }, "Operator": "equal", "Right": { "Type": "NumberLiteral", "Range": { "Start": 40, "End": 42 }, "Literal": "50", "Value": 50 } } }, { "Type": "FunctionCall", "Range": { "Start": 43, "End": 56 }, "Left": { "Type": "Identifier", "Range": { "Start": 43, "End": 48 }, "Literal": "print" }, "Args": [ { "Type": "StringLiteral", "Range": { "Start": 49, "End": 55 }, "Literal": "'done'" } ] } ] } }, { "Label": "return", "Input": "return foo, bar", "AST": { "Type": "Block", "Range": { "Start": 0, "End": 15 }, "Stmts": [ { "Type": "ReturnStatement", "Range": { "Start": 0, "End": 15 }, "Exps": [ { "Type": "Identifier", "Range": { "Start": 7, "End": 10 }, "Literal": "foo" }, { "Type": "Identifier", "Range": { "Start": 12, "End": 15 }, "Literal": "bar" } ] } ] } }, { "Label": "while", "Input": "local i = 0 while i \u003c 10 do i = i + 1 end", "AST": { "Type": "Block", "Range": { "Start": 0, "End": 41 }, "Stmts": [ { "Type": "LocalStatement", "Range": { "Start": 0, "End": 11 }, "Names": [ { "Type": "Identifier", "Range": { "Start": 6, "End": 7 }, "Literal": "i" } ], "Exps": [ { "Type": "NumberLiteral", "Range": { "Start": 10, "End": 11 }, "Literal": "0", "Value": 0 } ] }, { "Type": "WhileStatement", "Range": { "Start": 12, "End": 41 }, "Condition": { "Type": "InfixExpression", "Range": { "Start": 18, "End": 24 }, "Left": { "Type": "Identifier", "Range": { "Start": 18, "End": 19 }, "Literal": "i" }, "Operator": "lt", "Right": { "Type": "NumberLiteral", "Range": { "Start": 22, "End": 24 }, "Literal": "10", "Value": 10 } }, "Body": { "Type": "Block", "Range": { "Start": 28, "End": 37 }, "Stmts": [ { "Type": "AssignmentStatement", "Range": { "Start": 28, "End": 37 }, "Vars": [ { "Type": "Identifier", "Range": { "Start": 28, "End": 29 }, "Literal": "i" } ], "Exps": [ { "Type": "InfixExpression", "Range": { "Start": 32, "End": 37 }, "Left": { "Type": "Identifier", "Range": { "Start": 32, "End": 33 }, "Literal": "i" }, "Operator": "plus", "Right": { "Type": "NumberLiteral", "Range": { "Start": 36, "End": 37 }, "Literal": "1", "Value": 1 } } ] } ] } } ] } } ]