<commit_before>compile = (code) ->
  try
    sexp = Opal.Opal.Parser.$new().$parse(code)
    return Opal.Object.__proto__.$statements_to_pos_to_result(sexp)
  catch e
    console.error e.stack
    throw e

module.exports = { compile: compile }<commit_msg>Show compile-time errors as program output<commit_after>compile = (code) ->
  try
    sexp = Opal.Opal.Parser.$new().$parse(code)
    hash = Opal.Object.__proto__.$statements_to_pos_to_result(sexp)
  catch ruby_exception
    hash =
      map:
        start: 1
        1:
          map:
            output: "#{ruby_exception.name}: #{ruby_exception.message}"
            next: 'finish'
  hash

module.exports = { compile: compile }
{'fraction_non_alphanumeric': 0.12262773722627737, 'fraction_numerical': 0.00291970802919708, 'mean_word_length': 2.8757062146892656, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2842503', 'n_tokens_mistral': 231, 'n_tokens_neox': 224, 'n_words': 45}