asm: fix compiler warnings
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
#include "assembler.h"
|
||||
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/ident.h>
|
||||
#include <ivy/selector.h>
|
||||
#include <blue/core/hash.h>
|
||||
#include <blue/object/dict.h>
|
||||
#include <blue/object/number.h>
|
||||
#include <blue/object/string.h>
|
||||
#include <blue/core/hash.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/ident.h>
|
||||
#include <ivy/selector.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -23,7 +23,8 @@ static enum ivy_status init_scope(
|
||||
|
||||
assembler_write_data(as, &header, sizeof header);
|
||||
|
||||
struct constpool_assembler_scope *c = (struct constpool_assembler_scope *)scope;
|
||||
struct constpool_assembler_scope *c
|
||||
= (struct constpool_assembler_scope *)scope;
|
||||
c->s_strings = b_dict_create();
|
||||
|
||||
return IVY_OK;
|
||||
@@ -49,7 +50,8 @@ static void put_cached_string(
|
||||
|
||||
static ivy_extended_data_key write_string(struct ivy_assembler *as, const char *s)
|
||||
{
|
||||
struct constpool_assembler_scope *scope = (struct constpool_assembler_scope *)assembler_get_scope(as);
|
||||
struct constpool_assembler_scope *scope
|
||||
= (struct constpool_assembler_scope *)assembler_get_scope(as);
|
||||
|
||||
ivy_extended_data_key key = get_cached_string(scope, s);
|
||||
if (key != IVY_EX_DATA_KEY_NULL) {
|
||||
@@ -100,7 +102,8 @@ static ivy_extended_data_key write_selector(
|
||||
|
||||
b_queue_iterator it = {0};
|
||||
b_queue_foreach (&it, &sel->sel_args) {
|
||||
struct ivy_selector_arg *arg = b_unbox(struct ivy_selector_arg, it.entry, arg_entry);
|
||||
struct ivy_selector_arg *arg
|
||||
= b_unbox(struct ivy_selector_arg, it.entry, arg_entry);
|
||||
arg_handles[i++] = write_string(as, arg->arg_label);
|
||||
}
|
||||
|
||||
@@ -128,7 +131,8 @@ static ivy_extended_data_key write_ident(
|
||||
= calloc(nr_parts, sizeof(ivy_extended_data_key));
|
||||
b_queue_iterator it = {0};
|
||||
b_queue_foreach (&it, &id->id_parts) {
|
||||
struct ivy_ident_part *arg = b_unbox(struct ivy_ident_part, it.entry, p_entry);
|
||||
struct ivy_ident_part *arg
|
||||
= b_unbox(struct ivy_ident_part, it.entry, p_entry);
|
||||
part_handles[i++] = write_string(as, arg->p_str);
|
||||
}
|
||||
|
||||
@@ -148,7 +152,8 @@ static ivy_extended_data_key write_ident(
|
||||
|
||||
static enum ivy_status put_pval(
|
||||
struct ivy_assembler *as, struct assembler_scope *scope,
|
||||
enum ivy_assembler_pval_type type, const void *val, ivy_extended_data_key *key)
|
||||
enum ivy_assembler_pval_type type, const void *val,
|
||||
ivy_extended_data_key *key)
|
||||
{
|
||||
struct ivy_bin_constpool_table_entry entry = {0};
|
||||
uintptr_t i = *(uintptr_t *)val;
|
||||
|
||||
@@ -56,7 +56,10 @@ enum ivy_assembler_scope_type {
|
||||
|
||||
typedef unsigned long long ivy_assembler_attrib_table[__IVY_ASM_ATTRIB_COUNT];
|
||||
|
||||
IVY_API enum ivy_static ivy_assembler_create(FILE *out, struct ivy_assembler **as);
|
||||
#define IVY_ASSEMBLER_ATTRIB_TABLE_SIZE \
|
||||
(sizeof(unsigned long long) * __IVY_ASM_ATTRIB_COUNT)
|
||||
|
||||
IVY_API enum ivy_status ivy_assembler_create(FILE *out, struct ivy_assembler **as);
|
||||
IVY_API enum ivy_status ivy_assembler_finish(struct ivy_assembler *as);
|
||||
|
||||
IVY_API enum ivy_status ivy_assembler_begin_scope(
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "parse.h"
|
||||
#include <ivy/ident.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
|
||||
#include <ivy/asm/assembler.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/asm/lex.h>
|
||||
#include <ivy/ident.h>
|
||||
|
||||
struct atom_parser_state {
|
||||
struct parser_state s_base;
|
||||
@@ -11,18 +12,17 @@ struct atom_parser_state {
|
||||
struct ivy_asm_token *s_name;
|
||||
};
|
||||
|
||||
static enum ivy_status init_state(
|
||||
struct ivy_asm_parser *ctx, struct parser_state *s)
|
||||
static void init_state(struct ivy_asm_parser *ctx, struct parser_state *s)
|
||||
{
|
||||
struct atom_parser_state *state = (struct atom_parser_state *)s;
|
||||
state->s_prev_token = IVY_ASM_SYM_LEFT_PAREN;
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
static enum ivy_status parse_ident(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct atom_parser_state *state = (struct atom_parser_state *)asm_parser_get_state(ctx);
|
||||
struct atom_parser_state *state
|
||||
= (struct atom_parser_state *)asm_parser_get_state(ctx);
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
}
|
||||
@@ -40,7 +40,8 @@ static enum ivy_status parse_ident(
|
||||
static enum ivy_status parse_right_paren(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct atom_parser_state *state = (struct atom_parser_state *)asm_parser_get_state(ctx);
|
||||
struct atom_parser_state *state
|
||||
= (struct atom_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_TOK_IDENT) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "parse.h"
|
||||
|
||||
#include <blue/core/hash.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <ivy/asm/assembler.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/ident.h>
|
||||
#include <ivy/selector.h>
|
||||
#include <blue/core/hash.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define HASH_SELF 0x2d19e518d40792b7
|
||||
#define HASH_POOL 0x8c22f10da88b1083
|
||||
@@ -107,7 +107,7 @@ static unsigned long long get_register_index(struct ivy_asm_token *tok)
|
||||
static enum index_base get_index_base(struct ivy_asm_token *tok)
|
||||
{
|
||||
if (tok->t_type != IVY_ASM_TOK_IDENT) {
|
||||
return REG_INDEX_INVALID;
|
||||
return INDEX_NONE;
|
||||
}
|
||||
|
||||
const char *s = tok->t_str;
|
||||
@@ -148,7 +148,8 @@ static enum ivy_status write_instruction(struct block_parser_state *state)
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
static enum ivy_status push_const_arg(struct block_parser_state *state, struct ivy_asm_token *tok)
|
||||
static enum ivy_status push_const_arg(
|
||||
struct block_parser_state *state, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct arg *arg = malloc(sizeof *arg);
|
||||
if (!arg) {
|
||||
@@ -165,7 +166,8 @@ static enum ivy_status push_const_arg(struct block_parser_state *state, struct i
|
||||
}
|
||||
|
||||
static enum ivy_status push_reg_arg(
|
||||
struct block_parser_state *state, struct ivy_asm_token *tok, unsigned long long reg_index)
|
||||
struct block_parser_state *state, struct ivy_asm_token *tok,
|
||||
unsigned long long reg_index)
|
||||
{
|
||||
struct arg *arg = malloc(sizeof *arg);
|
||||
if (!arg) {
|
||||
@@ -258,7 +260,6 @@ static enum ivy_status parse_ident(
|
||||
return IVY_OK;
|
||||
default:
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
|
||||
}
|
||||
|
||||
/* not sure what this is but we aren't expecting it. */
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "parse.h"
|
||||
#include <ivy/ident.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
|
||||
#include <ivy/asm/assembler.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/asm/lex.h>
|
||||
#include <ivy/ident.h>
|
||||
|
||||
struct ident_parser_state {
|
||||
struct parser_state s_base;
|
||||
@@ -11,19 +12,19 @@ struct ident_parser_state {
|
||||
b_queue s_parts;
|
||||
};
|
||||
|
||||
static enum ivy_status init_state(
|
||||
struct ivy_asm_parser *ctx, struct parser_state *s)
|
||||
static void init_state(struct ivy_asm_parser *ctx, struct parser_state *s)
|
||||
{
|
||||
struct ident_parser_state *state = (struct ident_parser_state *)s;
|
||||
state->s_prev_token = IVY_ASM_SYM_LEFT_PAREN;
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
static enum ivy_status parse_ident(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct ident_parser_state *state = (struct ident_parser_state *)asm_parser_get_state(ctx);
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN && state->s_prev_token != IVY_ASM_SYM_DOT) {
|
||||
struct ident_parser_state *state
|
||||
= (struct ident_parser_state *)asm_parser_get_state(ctx);
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN
|
||||
&& state->s_prev_token != IVY_ASM_SYM_DOT) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
}
|
||||
|
||||
@@ -36,7 +37,8 @@ static enum ivy_status parse_ident(
|
||||
static enum ivy_status parse_dot(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct ident_parser_state *state = (struct ident_parser_state *)asm_parser_get_state(ctx);
|
||||
struct ident_parser_state *state
|
||||
= (struct ident_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_TOK_IDENT) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
@@ -50,7 +52,8 @@ static enum ivy_status parse_dot(
|
||||
static enum ivy_status parse_right_paren(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct ident_parser_state *state = (struct ident_parser_state *)asm_parser_get_state(ctx);
|
||||
struct ident_parser_state *state
|
||||
= (struct ident_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_TOK_IDENT) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
@@ -61,7 +64,8 @@ static enum ivy_status parse_right_paren(
|
||||
b_queue_iterator it = {0};
|
||||
b_queue_iterator_begin(&state->s_parts, &it);
|
||||
while (b_queue_iterator_is_valid(&it)) {
|
||||
struct ivy_asm_token *tok = b_unbox(struct ivy_asm_token, it.entry, t_entry);
|
||||
struct ivy_asm_token *tok
|
||||
= b_unbox(struct ivy_asm_token, it.entry, t_entry);
|
||||
b_queue_iterator_erase(&it);
|
||||
|
||||
ivy_ident_add_part(ident, tok->t_str);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include <ivy/asm/parse.h>
|
||||
#include "parse.h"
|
||||
|
||||
#include <ivy/asm/lex.h>
|
||||
#include <ivy/asm/parse.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "parse.h"
|
||||
|
||||
extern struct parser_state_type unit_parser_state_type;
|
||||
extern struct parser_state_type constpool_parser_state_type;
|
||||
@@ -21,7 +22,8 @@ static const struct parser_state_type *parser_state_types[] = {
|
||||
[ASM_PARSER_IMPORT] = &import_parser_state_type,
|
||||
[ASM_PARSER_BLOCK] = &block_parser_state_type,
|
||||
};
|
||||
static const size_t nr_parser_state_types = sizeof parser_state_types / sizeof parser_state_types[0];
|
||||
static const size_t nr_parser_state_types
|
||||
= sizeof parser_state_types / sizeof parser_state_types[0];
|
||||
|
||||
enum ivy_status ivy_asm_parser_create(struct ivy_asm_parser **out)
|
||||
{
|
||||
@@ -44,13 +46,13 @@ void ivy_asm_parser_destroy(struct ivy_asm_parser *p)
|
||||
free(p);
|
||||
}
|
||||
|
||||
void ivy_asm_parser_set_assembler(
|
||||
struct ivy_asm_parser *p, struct ivy_assembler *as)
|
||||
void ivy_asm_parser_set_assembler(struct ivy_asm_parser *p, struct ivy_assembler *as)
|
||||
{
|
||||
p->p_assembler = as;
|
||||
}
|
||||
|
||||
static token_parse_function get_token_parser(struct parser_state *state, struct ivy_asm_token *tok)
|
||||
static token_parse_function get_token_parser(
|
||||
struct parser_state *state, struct ivy_asm_token *tok)
|
||||
{
|
||||
const struct parser_state_type *type = state->s_type;
|
||||
if (!type) {
|
||||
@@ -59,17 +61,23 @@ static token_parse_function get_token_parser(struct parser_state *state, struct
|
||||
|
||||
token_parse_function specific_parser = NULL;
|
||||
token_parse_function specific_fallback_parser = NULL;
|
||||
token_parse_function token_parser = type->n_token_parsers[__TOK_PARSER_INDEX(tok->t_type)];
|
||||
token_parse_function token_fallback_parser = type->n_token_parsers[__TOK_PARSER_FALLBACK_INDEX];
|
||||
token_parse_function token_parser
|
||||
= type->n_token_parsers[__TOK_PARSER_INDEX(tok->t_type)];
|
||||
token_parse_function token_fallback_parser
|
||||
= type->n_token_parsers[__TOK_PARSER_FALLBACK_INDEX];
|
||||
|
||||
switch (tok->t_type) {
|
||||
case IVY_ASM_TOK_SYMBOL:
|
||||
specific_parser = type->n_symbol_parsers[__SYM_PARSER_INDEX(tok->t_symbol)];
|
||||
specific_fallback_parser = type->n_symbol_parsers[__SYM_PARSER_FALLBACK_INDEX];
|
||||
specific_parser
|
||||
= type->n_symbol_parsers[__SYM_PARSER_INDEX(tok->t_symbol)];
|
||||
specific_fallback_parser
|
||||
= type->n_symbol_parsers[__SYM_PARSER_FALLBACK_INDEX];
|
||||
break;
|
||||
case IVY_ASM_TOK_KEYWORD:
|
||||
specific_parser = type->n_keyword_parsers[__KW_PARSER_INDEX(tok->t_keyword)];
|
||||
specific_fallback_parser = type->n_keyword_parsers[__KW_PARSER_FALLBACK_INDEX];
|
||||
specific_parser
|
||||
= type->n_keyword_parsers[__KW_PARSER_INDEX(tok->t_keyword)];
|
||||
specific_fallback_parser
|
||||
= type->n_keyword_parsers[__KW_PARSER_FALLBACK_INDEX];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -107,7 +115,8 @@ enum ivy_status ivy_asm_parser_push_token(
|
||||
return f(p, tok);
|
||||
}
|
||||
|
||||
static const struct parser_state_type *get_parser_state_type(enum parser_state_type_id type)
|
||||
static const struct parser_state_type *get_parser_state_type(
|
||||
enum parser_state_type_id type)
|
||||
{
|
||||
if (type < 0 || type >= nr_parser_state_types) {
|
||||
return NULL;
|
||||
@@ -137,7 +146,7 @@ struct parser_state *asm_parser_push_state(
|
||||
state->s_type = type_info;
|
||||
|
||||
if (attrib) {
|
||||
memcpy(state->s_attrib, attrib, sizeof attrib);
|
||||
memcpy(state->s_attrib, attrib, IVY_ASSEMBLER_ATTRIB_TABLE_SIZE);
|
||||
}
|
||||
|
||||
if (type_info->n_init_state) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef _PARSE_PARSE_H_
|
||||
#define _PARSE_PARSE_H_
|
||||
|
||||
#include <blue/core/queue.h>
|
||||
#include <ivy/asm/assembler.h>
|
||||
#include <ivy/asm/lex.h>
|
||||
#include <blue/core/queue.h>
|
||||
|
||||
#define __TOK_PARSER_INDEX(x) ((x) - __IVY_ASM_TOK_INDEX_BASE)
|
||||
#define __SYM_PARSER_INDEX(x) ((x) - __IVY_ASM_SYM_INDEX_BASE)
|
||||
@@ -22,6 +22,7 @@
|
||||
#define KW_PARSER_FALLBACK(func) [__KW_PARSER_FALLBACK_INDEX] = func
|
||||
|
||||
struct ivy_asm_parser;
|
||||
struct parser_state;
|
||||
|
||||
enum parser_state_type_id {
|
||||
ASM_PARSER_NONE = 0,
|
||||
@@ -43,8 +44,6 @@ struct parser_state_type {
|
||||
|
||||
void (*n_init_state)(struct ivy_asm_parser*, struct parser_state*);
|
||||
void (*n_finish_state)(struct ivy_asm_parser*, struct parser_state*);
|
||||
enum ivy_status (*n_add_child)(
|
||||
struct parser_state *, struct ivy_ast_node *);
|
||||
|
||||
token_parse_function n_token_parsers[__TOK_PARSER_INDEX(__IVY_ASM_TOK_INDEX_LIMIT)];
|
||||
token_parse_function n_keyword_parsers[__KW_PARSER_INDEX(__IVY_ASM_KW_INDEX_LIMIT)];
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "parse.h"
|
||||
#include <ivy/selector.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
|
||||
#include <ivy/asm/assembler.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/asm/lex.h>
|
||||
#include <ivy/selector.h>
|
||||
|
||||
struct selector_parser_state {
|
||||
struct parser_state s_base;
|
||||
@@ -13,20 +14,21 @@ struct selector_parser_state {
|
||||
struct ivy_selector *s_sel;
|
||||
};
|
||||
|
||||
static enum ivy_status init_state(
|
||||
struct ivy_asm_parser *ctx, struct parser_state *s)
|
||||
static void init_state(struct ivy_asm_parser *ctx, struct parser_state *s)
|
||||
{
|
||||
struct selector_parser_state *state = (struct selector_parser_state *)s;
|
||||
state->s_prev_token = IVY_ASM_SYM_LEFT_PAREN;
|
||||
return ivy_selector_create(&state->s_sel);
|
||||
ivy_selector_create(&state->s_sel);
|
||||
}
|
||||
|
||||
static enum ivy_status parse_ident(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct selector_parser_state *state = (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
struct selector_parser_state *state
|
||||
= (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
if (state->s_prev_token == IVY_ASM_TOK_LABEL && state->s_prev_label) {
|
||||
ivy_selector_add_arg(state->s_sel, state->s_prev_label->t_str, tok->t_str);
|
||||
ivy_selector_add_arg(
|
||||
state->s_sel, state->s_prev_label->t_str, tok->t_str);
|
||||
ivy_asm_token_destroy(tok);
|
||||
ivy_asm_token_destroy(state->s_prev_label);
|
||||
state->s_prev_label = tok;
|
||||
@@ -34,7 +36,9 @@ static enum ivy_status parse_ident(
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN && state->s_prev_token != IVY_ASM_SYM_HYPHEN && state->s_prev_token != IVY_ASM_SYM_PLUS) {
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN
|
||||
&& state->s_prev_token != IVY_ASM_SYM_HYPHEN
|
||||
&& state->s_prev_token != IVY_ASM_SYM_PLUS) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
}
|
||||
|
||||
@@ -48,7 +52,8 @@ static enum ivy_status parse_ident(
|
||||
static enum ivy_status parse_label(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct selector_parser_state *state = (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
struct selector_parser_state *state
|
||||
= (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN
|
||||
&& state->s_prev_token != IVY_ASM_TOK_LABEL
|
||||
&& state->s_prev_token != IVY_ASM_SYM_HYPHEN
|
||||
@@ -71,7 +76,8 @@ static enum ivy_status parse_label(
|
||||
static enum ivy_status parse_hyphen(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct selector_parser_state *state = (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
struct selector_parser_state *state
|
||||
= (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
@@ -86,7 +92,8 @@ static enum ivy_status parse_hyphen(
|
||||
static enum ivy_status parse_plus(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct selector_parser_state *state = (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
struct selector_parser_state *state
|
||||
= (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_SYM_LEFT_PAREN) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
@@ -101,7 +108,8 @@ static enum ivy_status parse_plus(
|
||||
static enum ivy_status parse_left_paren(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct selector_parser_state *state = (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
struct selector_parser_state *state
|
||||
= (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_TOK_IDENT) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
@@ -120,9 +128,12 @@ static enum ivy_status parse_left_paren(
|
||||
static enum ivy_status parse_right_paren(
|
||||
struct ivy_asm_parser *ctx, struct ivy_asm_token *tok)
|
||||
{
|
||||
struct selector_parser_state *state = (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
struct selector_parser_state *state
|
||||
= (struct selector_parser_state *)asm_parser_get_state(ctx);
|
||||
|
||||
if (state->s_prev_token != IVY_ASM_TOK_IDENT && state->s_prev_token != IVY_ASM_TOK_LABEL && state->s_prev_token != IVY_ASM_SYM_RIGHT_PAREN) {
|
||||
if (state->s_prev_token != IVY_ASM_TOK_IDENT
|
||||
&& state->s_prev_token != IVY_ASM_TOK_LABEL
|
||||
&& state->s_prev_token != IVY_ASM_SYM_RIGHT_PAREN) {
|
||||
return IVY_ERR_BAD_SYNTAX;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user