Skip to content

Add the __ENCODING__ keyword - #486

Merged
tannevaled merged 1 commit into
mainfrom
feat/encoding-keyword
Aug 29, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/encoding-keyword

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

__ENCODING__ evaluates to the source file's encoding. rbgo scripts are UTF-8,
so the compiler rewrites the bare keyword to Encoding::UTF_8 (an intrinsic
beside binding), making it work at the top level, in a method body and as a
sub-expression.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises 16260 → 16270 (language/magic_comment +9,
language/encoding +1, zero regressions in a per-file sweep).

🤖 Generated with Claude Code

__ENCODING__ evaluates to the source file's encoding. rbgo scripts are UTF-8, so
the compiler rewrites the bare keyword to Encoding::UTF_8 (an intrinsic beside
binding), making it work at the top level, in a method body and as a
sub-expression.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
floor rises 16260 -> 16270 (language/magic_comment +9, language/encoding +1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit bcd4995 into main Aug 29, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/encoding-keyword branch August 29, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant