lang: ast: fix compiler warnings
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include "node.h"
|
||||
|
||||
#include <ivy/lang/ast.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern struct ast_node_type unit_node_ops;
|
||||
extern struct ast_node_type unit_package_node_ops;
|
||||
@@ -80,7 +80,8 @@ enum ivy_status ast_node_add_child(
|
||||
return add_child(parent, child);
|
||||
}
|
||||
|
||||
static enum ivy_status node_print(struct ivy_ast_node *node, struct ivy_ast_node_iterator *it)
|
||||
static enum ivy_status node_print(
|
||||
struct ivy_ast_node *node, struct ivy_ast_node_iterator *it)
|
||||
{
|
||||
for (unsigned int i = 0; i < node->n_it.it_depth; i++) {
|
||||
fputs(" ", stdout);
|
||||
@@ -165,7 +166,7 @@ const char *ivy_ast_op_to_string(enum ivy_ast_op v)
|
||||
}
|
||||
}
|
||||
|
||||
const char *ivy_ast_msgh_recipient_type_to_string(enum ivy_ast_op v)
|
||||
const char *ivy_ast_msgh_recipient_type_to_string(enum ivy_ast_msgh_recipient_type v)
|
||||
{
|
||||
switch (v) {
|
||||
ENUM_STR(IVY_AST_MSGH_NONE);
|
||||
|
||||
@@ -69,8 +69,6 @@ struct ivy_ast_node_iterator_entry {
|
||||
unsigned int it_depth;
|
||||
};
|
||||
|
||||
typedef enum ivy_status(*ivy_ast_node_iteration_callback)(struct ivy_ast_node *, struct ivy_ast_node_iterator *);
|
||||
|
||||
struct ivy_ast_node {
|
||||
enum ivy_ast_node_type n_type;
|
||||
b_queue_entry n_entry;
|
||||
@@ -239,6 +237,9 @@ struct ivy_ast_do_node {
|
||||
b_queue n_members;
|
||||
};
|
||||
|
||||
typedef enum ivy_status (*ivy_ast_node_iteration_callback)(
|
||||
struct ivy_ast_node *, struct ivy_ast_node_iterator *);
|
||||
|
||||
IVY_API enum ivy_status ivy_parser_create(struct ivy_parser **parser);
|
||||
IVY_API void ivy_parser_destroy(struct ivy_parser *parser);
|
||||
|
||||
@@ -251,8 +252,7 @@ IVY_API enum ivy_status ivy_parser_push_token(
|
||||
struct ivy_parser *parser, struct ivy_token *tok);
|
||||
|
||||
IVY_API enum ivy_status ivy_ast_node_iterate(
|
||||
struct ivy_ast_node *node,
|
||||
struct ivy_ast_node_iterator *it,
|
||||
struct ivy_ast_node *node, struct ivy_ast_node_iterator *it,
|
||||
ivy_ast_node_iteration_callback callback);
|
||||
IVY_API void ivy_ast_node_print(struct ivy_ast_node *node);
|
||||
IVY_API void ivy_ast_node_destroy(struct ivy_ast_node *node);
|
||||
|
||||
Reference in New Issue
Block a user