meta: replace bluelib with fx
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "../debug.h"
|
||||
#include "codegen.h"
|
||||
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <fx/core/stringstream.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -98,7 +98,7 @@ static struct code_generator_result gen_selector(
|
||||
msg->s_prev_part = MSG_SELECTOR;
|
||||
|
||||
msg->s_nr_args = 0;
|
||||
msg->s_max_args = b_queue_length(&msg->s_selector->n_arg_labels);
|
||||
msg->s_max_args = fx_queue_length(&msg->s_selector->n_arg_labels);
|
||||
msg->s_args = calloc(msg->s_max_args, sizeof(struct mie_value *));
|
||||
|
||||
if (!msg->s_args) {
|
||||
@@ -126,38 +126,38 @@ static enum ivy_status state_init(
|
||||
}
|
||||
|
||||
static void serialise_selector(
|
||||
struct ivy_ast_selector_node *sel, b_stringstream *out)
|
||||
struct ivy_ast_selector_node *sel, fx_stringstream *out)
|
||||
{
|
||||
b_stream_write_string(out, "_M", NULL);
|
||||
fx_stream_write_string(out, "_M", NULL);
|
||||
|
||||
if (sel->n_msg_name) {
|
||||
const char *msg_name = sel->n_msg_name->t_str;
|
||||
b_stream_write_fmt(out, NULL, "%zu%s", strlen(msg_name), msg_name);
|
||||
fx_stream_write_fmt(out, NULL, "%zu%s", strlen(msg_name), msg_name);
|
||||
} else {
|
||||
b_stream_write_char(out, '0');
|
||||
fx_stream_write_char(out, '0');
|
||||
}
|
||||
|
||||
b_queue_entry *entry = b_queue_first(&sel->n_arg_labels);
|
||||
fx_queue_entry *entry = fx_queue_first(&sel->n_arg_labels);
|
||||
while (entry) {
|
||||
struct ivy_token *arg = b_unbox(struct ivy_token, entry, t_entry);
|
||||
struct ivy_token *arg = fx_unbox(struct ivy_token, entry, t_entry);
|
||||
|
||||
if (arg->t_type != IVY_TOK_IDENT && arg->t_type != IVY_TOK_LABEL) {
|
||||
b_stream_write_char(out, '0');
|
||||
fx_stream_write_char(out, '0');
|
||||
goto next;
|
||||
}
|
||||
|
||||
const char *label = arg->t_str;
|
||||
|
||||
if (label) {
|
||||
b_stream_write_fmt(out, NULL, "%zu%s", strlen(label), label);
|
||||
fx_stream_write_fmt(out, NULL, "%zu%s", strlen(label), label);
|
||||
} else {
|
||||
b_stream_write_char(out, '0');
|
||||
fx_stream_write_char(out, '0');
|
||||
}
|
||||
next:
|
||||
entry = b_queue_next(entry);
|
||||
entry = fx_queue_next(entry);
|
||||
}
|
||||
|
||||
b_stream_write_char(out, 'E');
|
||||
fx_stream_write_char(out, 'E');
|
||||
}
|
||||
|
||||
static enum ivy_status state_fini(
|
||||
@@ -168,10 +168,10 @@ static enum ivy_status state_fini(
|
||||
|
||||
struct msg_codegen_state *msg = (struct msg_codegen_state *)state;
|
||||
|
||||
b_stringstream *str = b_stringstream_create();
|
||||
fx_stringstream *str = fx_stringstream_create();
|
||||
serialise_selector(msg->s_selector, str);
|
||||
char *sel = b_stringstream_steal(str);
|
||||
b_stringstream_unref(str);
|
||||
char *sel = fx_stringstream_steal(str);
|
||||
fx_stringstream_unref(str);
|
||||
|
||||
struct mie_value *sel_value = mie_ctx_get_selector(gen->c_ctx, sel);
|
||||
free(sel);
|
||||
|
||||
Reference in New Issue
Block a user