<commit_before>#include "lily_impl.h"
#include "lily_symtab.h"
#include "lily_opcode.h"

#define FAST_INTEGER_OP(OP) \
((lily_sym *)code[i+3])->value.integer = \
((lily_sym *)code[i+1])->value.integer OP \
((lily_sym *)code[i+2])->value.integer; \
i += 4; \

#define NUMBER_OP(OP) \
lhs = (lily_sym *)code[i+1]; \
if (lhs->sig->cls->id == SYM_CLASS_NUMBER) { \
    rhs = (lily_sym *)code[i+2]; \
    if (rhs->sig->cls->id == SYM_CLASS_NUMBER) \
        ((lily_sym *)code[i+3])->value.number = \
        lhs->value.number OP rhs->value.number; \
    else \
        ((lily_sym *)code[i+3])->value.number = \
        lhs->value.number OP rhs->value.integer; \
} \
else \
    ((lily_sym *)code[i+3])->value.number = \
    lhs->value.integer OP ((lily_sym *)code[i+2])->value.number; \
i += 4;

void lily_builtin_print(lily_sym **args)
{
    lily_impl_send_html(((lily_strval *)args[0]->value.ptr)->str);
}

void lily_vm_execute(lily_excep_data *error, lily_var *var)
{
    lily_func_prop *fp = var->properties;
    int *code, i, len;
    lily_sym *lhs, *rhs;

    code = fp->code;
    len = fp->len;
    i = 0;

    while (i != len) {
        switch(code[i]) {
            case o_assign:
                lhs = ((lily_sym *)code[i+1]);
                lhs->flags &= ~S_IS_NIL;
                lhs->value = ((lily_sym *)code[i+2])->value;
                i += 3;
                break;
            case o_integer_add:
                FAST_INTEGER_OP(+)
                break;
            case o_integer_minus:
                FAST_INTEGER_OP(-)
                break;
            case o_number_add:
                NUMBER_OP(+)
                break;
            case o_number_minus:
                NUMBER_OP(-)
                break;
            case o_func_call:
            {
                /* var, func, #args, args... */
                lily_fast_func fc = (lily_fast_func)code[i+2];
                int j = code[i+3];
                fc((lily_sym **)code+i+4);
                i += 4+j;
            }
            case o_vm_return:
                return;
        }
    }
}<commit_msg>vm: Break after o_func_call. Oops.<commit_after>#include "lily_impl.h"
#include "lily_symtab.h"
#include "lily_opcode.h"

#define FAST_INTEGER_OP(OP) \
((lily_sym *)code[i+3])->value.integer = \
((lily_sym *)code[i+1])->value.integer OP \
((lily_sym *)code[i+2])->value.integer; \
i += 4; \

#define NUMBER_OP(OP) \
lhs = (lily_sym *)code[i+1]; \
if (lhs->sig->cls->id == SYM_CLASS_NUMBER) { \
    rhs = (lily_sym *)code[i+2]; \
    if (rhs->sig->cls->id == SYM_CLASS_NUMBER) \
        ((lily_sym *)code[i+3])->value.number = \
        lhs->value.number OP rhs->value.number; \
    else \
        ((lily_sym *)code[i+3])->value.number = \
        lhs->value.number OP rhs->value.integer; \
} \
else \
    ((lily_sym *)code[i+3])->value.number = \
    lhs->value.integer OP ((lily_sym *)code[i+2])->value.number; \
i += 4;

void lily_builtin_print(lily_sym **args)
{
    lily_impl_send_html(((lily_strval *)args[0]->value.ptr)->str);
}

void lily_vm_execute(lily_excep_data *error, lily_var *var)
{
    lily_func_prop *fp = var->properties;
    int *code, i, len;
    lily_sym *lhs, *rhs;

    code = fp->code;
    len = fp->len;
    i = 0;

    while (i != len) {
        switch(code[i]) {
            case o_assign:
                lhs = ((lily_sym *)code[i+1]);
                lhs->flags &= ~S_IS_NIL;
                lhs->value = ((lily_sym *)code[i+2])->value;
                i += 3;
                break;
            case o_integer_add:
                FAST_INTEGER_OP(+)
                break;
            case o_integer_minus:
                FAST_INTEGER_OP(-)
                break;
            case o_number_add:
                NUMBER_OP(+)
                break;
            case o_number_minus:
                NUMBER_OP(-)
                break;
            case o_func_call:
            {
                /* var, func, #args, args... */
                lily_fast_func fc = (lily_fast_func)code[i+2];
                int j = code[i+3];
                fc((lily_sym **)code+i+4);
                i += 4+j;
            }
                break;
            case o_vm_return:
                return;
        }
    }
}
{'fraction_non_alphanumeric': 0.16366223908918406, 'fraction_numerical': 0.009487666034155597, 'mean_word_length': 1.6859872611464968, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 55, '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': '552641', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1546, 'n_words': 263}