lua2js icon indicating copy to clipboard operation
lua2js copied to clipboard

Idea for Labels

Open ghost opened this issue 8 years ago • 0 comments

:: label1 ::

print(var); -- should really print nil

local var = "Hello";
local var = true;
goto label1;
(function() {
  var vararg;

  vararg = [];

  (function() {
    var $label1;

    $label1 = function() {
      call_function(
        index_table(_ENV, 'print'),
        [ index_table(_ENV, 'var') ]
      );

      var var$ = "Hello";
      var var$$ = true;

      /* goto label1 again */
      var lab_result = $label1();
      if (lab_result && lab_result.length)
        return r;
    };

    /* exec. label1 */
    var lab_result = $label1();
    if (lab_result && lab_result.length)
      return r;

    var var$ = "Hello";
    var var$$ = true;
    /* goto label1 */
    var lab_result = $label1();
    if (lab_result && lab_result.length)
      return r;

    return;

  })();
})();

ghost avatar Nov 02 '16 12:11 ghost