<commit_before>/*  rest.c -- low-level utilities for VM rest optimization    */
/*  Copyright (c) 2011 <NAME>.  All rights reserved.      */
/*  BSD-style license: http://synthcode.com/license.txt       */

#include <chibi/eval.h>

static sexp sexp_num_parameters (sexp ctx sexp_api_params(self, n)) {
  return sexp_stack_data(sexp_context_stack(ctx))[sexp_context_last_fp(ctx)];
}

struct sexp_opcode_struct local_ref_op =
  {SEXP_OPC_GENERIC, SEXP_OP_LOCAL_REF, 1, 8, 0, "local-ref", NULL, NULL,
   NULL, sexp_make_fixnum(SEXP_OBJECT), sexp_make_fixnum(SEXP_FIXNUM),
   0, 0, NULL};

static sexp sexp_copy_opcode (sexp ctx, struct sexp_opcode_struct *op) {
  sexp res = sexp_alloc_type(ctx, opcode, SEXP_OPCODE);
  memcpy(&(res->value), op, sizeof(op[0]));
  return res;
}

sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
  sexp_gc_var2(name, op);
  sexp_gc_preserve2(ctx, name, op);
  sexp_define_foreign(ctx, env, "num-parameters", 0, sexp_num_parameters);
  op = sexp_copy_opcode(ctx, &local_ref_op);
  name = sexp_intern(ctx, sexp_opcode_name(op), -1);
  sexp_env_define(ctx, env, name, op);
  sexp_gc_release2(ctx);
  return SEXP_VOID;
}<commit_msg>local_ref return type is void<commit_after>/*  rest.c -- low-level utilities for VM rest optimization    */
/*  Copyright (c) 2011 <NAME>.  All rights reserved.      */
/*  BSD-style license: http://synthcode.com/license.txt       */

#include <chibi/eval.h>

static sexp sexp_num_parameters (sexp ctx sexp_api_params(self, n)) {
  return sexp_stack_data(sexp_context_stack(ctx))[sexp_context_last_fp(ctx)];
}

struct sexp_opcode_struct local_ref_op =
  {SEXP_OPC_GENERIC, SEXP_OP_LOCAL_REF, 1, 8, 0, "local-ref", SEXP_VOID,
   NULL, NULL, sexp_make_fixnum(SEXP_OBJECT), sexp_make_fixnum(SEXP_FIXNUM),
   0, 0, NULL};

static sexp sexp_copy_opcode (sexp ctx, struct sexp_opcode_struct *op) {
  sexp res = sexp_alloc_type(ctx, opcode, SEXP_OPCODE);
  memcpy(&(res->value), op, sizeof(op[0]));
  return res;
}

sexp sexp_init_library (sexp ctx sexp_api_params(self, n), sexp env) {
  sexp_gc_var2(name, op);
  sexp_gc_preserve2(ctx, name, op);
  sexp_define_foreign(ctx, env, "num-parameters", 0, sexp_num_parameters);
  op = sexp_copy_opcode(ctx, &local_ref_op);
  name = sexp_intern(ctx, sexp_opcode_name(op), -1);
  sexp_env_define(ctx, env, name, op);
  sexp_gc_release2(ctx);
  return SEXP_VOID;
}
{'fraction_non_alphanumeric': 0.1319882303488861, 'fraction_numerical': 0.012610340479192938, 'mean_word_length': 5.181818181818182, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '325508', 'n_tokens_mistral': 985, 'n_tokens_neox': 959, 'n_words': 196}