Add rb_node_get_type for debuggers

This commit is contained in:
Nobuyoshi Nakada 2025-01-09 09:44:57 +09:00
parent 6069e8fea5
commit d44a41d814
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
2 changed files with 7 additions and 0 deletions

6
node.c
View File

@ -438,3 +438,9 @@ rb_node_set_type(NODE *n, enum node_type t)
{
return nd_init_type(n, t);
}
enum node_type
rb_node_get_type(const NODE *n)
{
return (enum node_type)nd_type(n);
}

1
node.h
View File

@ -67,6 +67,7 @@ const struct kwtable *rb_reserved_word(const char *, unsigned int);
struct parser_params;
PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3);
VALUE rb_node_set_type(NODE *n, enum node_type t);
enum node_type rb_node_get_type(const NODE *n);
RUBY_SYMBOL_EXPORT_END