Introduce NODE_ENCODING

`__ENCODING__ `was managed by `NODE_LIT` with Encoding object. 

Introduce `NODE_ENCODING` for
1. `__ENCODING__` is detectable from AST Node.
2. Reduce dependency Ruby object for parse.y
This commit is contained in:
S.H 2024-01-27 17:11:10 +09:00 committed by GitHub
parent 68b9a32a62
commit 9b40f42c22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 63 additions and 3 deletions

View file

@ -1008,3 +1008,9 @@ rb_node_file_path_val(const NODE *node)
{
return rb_str_new_parser_string(RNODE_FILE(node)->path);
}
VALUE
rb_node_encoding_val(const NODE *node)
{
return rb_enc_from_encoding(RNODE_ENCODING(node)->enc);
}