diff options
author | yui-knk <[email protected]> | 2024-01-08 12:20:03 +0900 |
---|---|---|
committer | Yuichiro Kaneko <[email protected]> | 2024-01-08 14:02:48 +0900 |
commit | 7ffff3e043b081a8c72b8f8c537f17388fd127a9 (patch) | |
tree | 635b6035cd6080d709588beade92e1f3c6364be2 /ruby_parser.c | |
parent | d9bad91c342d65332588672081597af5ab30fe97 (diff) |
Change numeric node value functions argument to `NODE *`
Change the argument to align with other node value functions
like `rb_node_line_lineno_val`.
Diffstat (limited to 'ruby_parser.c')
-rw-r--r-- | ruby_parser.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ruby_parser.c b/ruby_parser.c index eb05771f7e..6689483f45 100644 --- a/ruby_parser.c +++ b/ruby_parser.c @@ -46,8 +46,9 @@ compile_numeric_literal(char* val, int base) } VALUE -rb_node_integer_literal_val(rb_node_integer_t* node) +rb_node_integer_literal_val(const NODE *n) { + rb_node_integer_t *node = RNODE_INTEGER(n); VALUE val = compile_numeric_literal(node->val, node->base); if (node->minus) { val = compile_negative_numeric(val); @@ -56,8 +57,9 @@ rb_node_integer_literal_val(rb_node_integer_t* node) } VALUE -rb_node_float_literal_val(rb_node_float_t* node) +rb_node_float_literal_val(const NODE *n) { + rb_node_float_t *node = RNODE_FLOAT(n); double d = strtod(node->val, 0); if (node->minus) { d = -d; @@ -89,9 +91,10 @@ compile_rational_literal(char* node_val, int base, int seen_point) } VALUE -rb_node_rational_literal_val(rb_node_rational_t* node) +rb_node_rational_literal_val(const NODE *n) { VALUE lit; + rb_node_rational_t *node = RNODE_RATIONAL(n); lit = compile_rational_literal(node->val, node->base, node->seen_point); @@ -103,9 +106,10 @@ rb_node_rational_literal_val(rb_node_rational_t* node) } VALUE -rb_node_imaginary_literal_val(rb_node_imaginary_t* node) +rb_node_imaginary_literal_val(const NODE *n) { VALUE lit; + rb_node_imaginary_t *node = RNODE_IMAGINARY(n); enum rb_numeric_type type = node->type; |