From a66ead3cafa7ce77fb6863ca7c40bc2874a9543d Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 1 Nov 2026 15:13:15 -0500 Subject: [PATCH] Respect excludes properly in encoding --- CHANGELOG.md | 1 + include/prism/internal/encoding.h | 2 ++ test/prism/ruby/ripper_test.rb | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91f698a3af..743d3fe5fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Changed - `Prism::Translation::Parser` now returns a `nil` AST whenever an error is reported and errors are not fatal, matching the parser gem. +- `PRISM_BUILD_MINIMAL` now excludes the full set of encodings, as `PRISM_ENCODING_EXCLUDE_FULL` does. ## [2.1.0] - 2026-10-28 diff --git a/include/prism/internal/encoding.h b/include/prism/internal/encoding.h index 62392ef970..05e549f22e 100644 --- a/include/prism/internal/encoding.h +++ b/include/prism/internal/encoding.h @@ -1,6 +1,8 @@ #ifndef PRISM_INTERNAL_ENCODING_H #define PRISM_INTERNAL_ENCODING_H +#include "prism/excludes.h" + #include #include #include diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index b59e9e9370..aab4fc7260 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -241,10 +241,10 @@ def test_encoding_method source = "foo".b assert_equal(Ripper.new(source).tap(&:parse).encoding, Prism::Translation::Ripper.new(source).tap(&:parse).encoding) - source = "# encoding: shift_jis" + source = "# encoding: euc-jp" assert_equal(Ripper.new(source).tap(&:parse).encoding, Prism::Translation::Ripper.new(source).tap(&:parse).encoding) - source = "# encoding: shift_jis".b + source = "# encoding: euc-jp".b assert_equal(Ripper.new(source).tap(&:parse).encoding, Prism::Translation::Ripper.new(source).tap(&:parse).encoding) end