class Tryouts::PrismParser

def handle_syntax_errors

def handle_syntax_errors
  errors = @prism_result.errors.map do |error|
    line_context = @lines[error.location.start_line - 1] || ''
    TryoutSyntaxError.new(
      error.message,
      line_number: error.location.start_line,
      context: line_context,
      source_file: @source_path,
    )
  end
  raise errors.first if errors.any?
end