Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ext/prism/extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,10 @@ build_options_i(VALUE key, VALUE value, VALUE argument) {
const char *version = check_string(value);

if (RSTRING_LEN(value) == 7 && strncmp(version, "current", 7) == 0) {
const char *ruby_version = RSTRING_PTR(rb_const_get(rb_cObject, rb_intern("RUBY_VERSION")));
if (!pm_options_version_set(options, ruby_version, 3)) {
rb_exc_raise(rb_exc_new_cstr(rb_cPrismCurrentVersionError, ruby_version));
}
} else if (RSTRING_LEN(value) == 7 && strncmp(version, "nearest", 7) == 0) {
const char *ruby_version = RSTRING_PTR(rb_const_get(rb_cObject, rb_intern("RUBY_VERSION")));
const char *nearest_version;

if (ruby_version[0] < '3' || (ruby_version[0] == '3' && ruby_version[2] < '3')) {
Expand Down
1 change: 1 addition & 0 deletions ext/prism/extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <ruby.h>
#include <ruby/encoding.h>
#include <ruby/version.h>
#include "prism.h"

VALUE pm_source_new(const pm_parser_t *parser, rb_encoding *encoding, bool freeze);
Expand Down