asm/lex.c
static bool expand_define(struct Context *ctx, struct Token *token) {
    char data[256];
    assert(token->kind == TK_SYMBOL);
    assert(token_data(token, data, sizeof(data)));

    struct Define *d = ctx->defines;
    while (d != NULL && strcasecmp(data, d->name)) {
        d = d->next;
    }

    if (d == NULL) {
        return false;
    }

    asmdbg(
        ctx, token,
        "Expanding %s to %s in %s:%lu\n",
        data, d->value, token->input->name, token->line_no
    );

    if (d->value) {
        assert(!push_input_buffer(ctx, "(define)", d->value));
        return true;
    }

    return false;
}
// expands a potentially @define'd symbol
expands a potentially @define'd symbol
expands a potentially @define ' d symbol
static bool expand_define(struct Context *ctx, struct Token *token) {
    char data[256];
    assert(token->kind == TK_SYMBOL);
    assert(token_data(token, data, sizeof(data)));
    struct Define *d = ctx->defines;
    while (d != NULL && strcasecmp(data, d->name)) {
        d = d->next;
    }
    if (d == NULL) {
        return false;
    }
    asmdbg(
        ctx, token,
        "Expanding %s to %s in %s:%lu\n",
        data, d->value, token->input->name, token->line_no
    );
    if (d->value) {
        assert(!push_input_buffer(ctx, "(define)", d->value));
        return true;
    }
    return false;
}
static bool expand_define ( struct Context * ctx , struct Token * token ) { char data [ 256 ] ; assert ( token -> kind == TK_SYMBOL ) ; assert ( token_data ( token , data , sizeof ( data ) ) ) ; struct Define * d = ctx -> defines ; while ( d != NULL && strcasecmp ( data , d -> name ) ) { d = d -> next ; } if ( d == NULL ) { return false ; } asmdbg ( ctx , token , " \n " , data , d -> value , token -> input -> name , token -> line_no ) ; if ( d -> value ) { assert ( ! push_input_buffer ( ctx , " " , d -> value ) ) ; return true ; } return false ; }
expands a potentially @define'd symbol
expands a potentially @define ' d symbol