Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3d8af5d
Fix typo in documentation comment for exc_inspect method in error.c
ydah Aug 5, 2025
a6aaeb9
load.c: fix `prev_ext_config` clobbering in `require_internal`
ArtSin Aug 5, 2025
b7f65f0
[DOC] Tweaks for String#grapheme_clusters
BurdetteLamar Aug 1, 2025
409da39
[DOC] Tweaks for String#gsub
BurdetteLamar Aug 5, 2025
72b8bb4
[DOC] Tweaks for String#gsub!
BurdetteLamar Aug 3, 2025
8e9ea4c
Convert `PKG_CONFIG_PATH` to msys/cygwin path
nobu Aug 5, 2025
79d8a31
Check if the found pkg-config is usable actually
nobu Aug 5, 2025
4cfe5ba
Use snprintf instead of deprecated sprintf
etiennebarrie Aug 1, 2025
0e33256
CI: Use `\e` instead of `\033` [ci skip]
nobu Aug 5, 2025
95320f1
Fix RUBY_FREE_AT_EXIT for static symbols
peterzhu2118 Aug 5, 2025
3ef8d83
rb_gc_impl_mark_and_move: avoid needless writes
byroot Aug 1, 2025
18e37ac
[ruby/prism] Optimize context_terminator with a lookup table
kddnewton May 6, 2025
f814a77
[ruby/prism] Reject `true && not true`
mame Jun 13, 2025
087190f
[ruby/prism] Improve error handling for missing parentheses after 'no…
ydah Jul 7, 2025
2936da9
[ruby/prism] Handle new ractor stuff
kddnewton Jun 3, 2025
2e672fd
[ruby/prism] Bump JRuby version
kddnewton Apr 21, 2025
6e2b139
[ruby/prism] Ensure context terminators terminate expressions
kddnewton May 6, 2025
b482e3d
[ruby/prism] Make `it = it` assign `nil` to match parse.y behavior [B…
S-H-GAMELINKS Jul 21, 2025
02200ac
[ruby/prism] Add it read and assignment test
S-H-GAMELINKS Jul 23, 2025
a12e0c1
[ruby/prism] Remove uneeded test
S-H-GAMELINKS Jul 23, 2025
6bc07f1
[ruby/prism] Convert implicit parameter `it` to local variable in `pa…
S-H-GAMELINKS Jul 28, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ jobs:
# show where
result=true
for e in gcc.exe ragel.exe make.exe libcrypto-3-x64.dll libssl-3-x64.dll; do
echo ::group::$'\033[93m'$e$'\033[m'
echo ::group::$'\e[93m'$e$'\e[m'
where $e || result=false
echo ::endgroup::
done
# show version
for e in gcc ragel make "openssl version"; do
case "$e" in *" "*) ;; *) e="$e --version";; esac
echo ::group::$'\033[93m'$e$'\033[m'
echo ::group::$'\e[93m'$e$'\e[m'
$e || result=false
echo ::endgroup::
done
# show packages
echo ::group::$'\033[93m'Packages$'\033[m'
echo ::group::$'\e[93m'Packages$'\e[m'
pacman -Qs mingw-w64-ucrt-x86_64-* | sed -n "s,local/mingw-w64-ucrt-x86_64-,,p"
echo ::endgroup::
$result
Expand Down
15 changes: 14 additions & 1 deletion doc/string/grapheme_clusters.rdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Returns an array of the grapheme clusters in +self+
(see {Unicode Grapheme Cluster Boundaries}[https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries]):

s = "\u0061\u0308-pqr-\u0062\u0308-xyz-\u0063\u0308" # => "ä-pqr-b̈-xyz-c̈"
s = "ä-pqr-b̈-xyz-c̈"
s.size # => 16
s.bytesize # => 19
s.grapheme_clusters.size # => 13
s.grapheme_clusters
# => ["ä", "-", "p", "q", "r", "-", "b̈", "-", "x", "y", "z", "-", "c̈"]

Details:

s = "ä"
s.grapheme_clusters # => ["ä"] # One grapheme cluster.
s.bytes # => [97, 204, 136] # Three bytes.
s.chars # => ["a", "̈"] # Two characters.
s.chars.map {|char| char.ord } # => [97, 776] # Their values.

Related: see {Converting to Non-String}[rdoc-ref:String@Converting+to+Non--5CString].
2 changes: 1 addition & 1 deletion error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ exc_inspect(VALUE exc)
* # String
* end
*
* The value returned by this method migth be adjusted when raising (see Kernel#raise),
* The value returned by this method might be adjusted when raising (see Kernel#raise),
* or during intermediate handling by #set_backtrace.
*
* See also #backtrace_locations that provide the same value, as structured objects.
Expand Down
5 changes: 4 additions & 1 deletion gc/default/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -4420,7 +4420,10 @@ rb_gc_impl_mark_and_move(void *objspace_ptr, VALUE *ptr)
GC_ASSERT(objspace->flags.during_compacting);
GC_ASSERT(during_gc);

*ptr = rb_gc_impl_location(objspace, *ptr);
VALUE destination = rb_gc_impl_location(objspace, *ptr);
if (destination != *ptr) {
*ptr = destination;
}
}
else {
gc_mark(objspace, *ptr);
Expand Down
1 change: 1 addition & 0 deletions internal/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bool rb_obj_is_symbol_table(VALUE obj);
void rb_sym_global_symbol_table_foreach_weak_reference(int (*callback)(VALUE *key, void *data), void *data);
void rb_gc_free_dsymbol(VALUE);
int rb_static_id_valid_p(ID id);
void rb_free_global_symbol_table(void);

#if __has_builtin(__builtin_constant_p)
#define rb_sym_intern_ascii_cstr(ptr) \
Expand Down
6 changes: 3 additions & 3 deletions load.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,14 +1346,14 @@ rb_resolve_feature_path(VALUE klass, VALUE fname)
}

static void
ext_config_push(rb_thread_t *th, struct rb_ext_config *prev)
ext_config_push(rb_thread_t *th, volatile struct rb_ext_config *prev)
{
*prev = th->ext_config;
th->ext_config = (struct rb_ext_config){0};
}

static void
ext_config_pop(rb_thread_t *th, struct rb_ext_config *prev)
ext_config_pop(rb_thread_t *th, volatile struct rb_ext_config *prev)
{
th->ext_config = *prev;
}
Expand Down Expand Up @@ -1407,7 +1407,7 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
VALUE realpaths = get_loaded_features_realpaths(vm_ns);
VALUE realpath_map = get_loaded_features_realpath_map(vm_ns);
volatile bool reset_ext_config = false;
struct rb_ext_config prev_ext_config;
volatile struct rb_ext_config prev_ext_config;

path = rb_str_encode_ospath(fname);
RUBY_DTRACE_HOOK(REQUIRE_ENTRY, RSTRING_PTR(fname));
Expand Down
71 changes: 37 additions & 34 deletions prism/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,42 @@ warnings:
- UNUSED_LOCAL_VARIABLE
- VOID_STATEMENT
tokens:
# The order of the tokens at the beginning is important, because we use them
# for a lookup table.
- name: EOF
value: 1
comment: final token in the file
- name: MISSING
comment: "a token that was expected but not found"
- name: NOT_PROVIDED
comment: "a token that was not present but it is okay"
- name: BRACE_RIGHT
comment: "}"
- name: COMMA
comment: ","
- name: EMBEXPR_END
comment: "}"
- name: KEYWORD_DO
comment: "do"
- name: KEYWORD_ELSE
comment: "else"
- name: KEYWORD_ELSIF
comment: "elsif"
- name: KEYWORD_END
comment: "end"
- name: KEYWORD_ENSURE
comment: "ensure"
- name: KEYWORD_IN
comment: "in"
- name: KEYWORD_RESCUE
comment: "rescue"
- name: KEYWORD_THEN
comment: "then"
- name: KEYWORD_WHEN
comment: "when"
- name: NEWLINE
comment: "a newline character outside of other tokens"
- name: PARENTHESIS_RIGHT
comment: ")"
- name: SEMICOLON
comment: ";"
# Tokens from here on are not used for lookup, and can be in any order.
- name: AMPERSAND
comment: "&"
- name: AMPERSAND_AMPERSAND
Expand All @@ -351,8 +380,6 @@ tokens:
comment: "!~"
- name: BRACE_LEFT
comment: "{"
- name: BRACE_RIGHT
comment: "}"
- name: BRACKET_LEFT
comment: "["
- name: BRACKET_LEFT_ARRAY
Expand All @@ -375,8 +402,6 @@ tokens:
comment: ":"
- name: COLON_COLON
comment: "::"
- name: COMMA
comment: ","
- name: COMMENT
comment: "a comment"
- name: CONSTANT
Expand All @@ -395,8 +420,6 @@ tokens:
comment: "a line inside of embedded documentation"
- name: EMBEXPR_BEGIN
comment: "#{"
- name: EMBEXPR_END
comment: "}"
- name: EMBVAR
comment: "#"
- name: EQUAL
Expand Down Expand Up @@ -463,20 +486,10 @@ tokens:
comment: "def"
- name: KEYWORD_DEFINED
comment: "defined?"
- name: KEYWORD_DO
comment: "do"
- name: KEYWORD_DO_LOOP
comment: "do keyword for a predicate in a while, until, or for loop"
- name: KEYWORD_ELSE
comment: "else"
- name: KEYWORD_ELSIF
comment: "elsif"
- name: KEYWORD_END
comment: "end"
- name: KEYWORD_END_UPCASE
comment: "END"
- name: KEYWORD_ENSURE
comment: "ensure"
- name: KEYWORD_FALSE
comment: "false"
- name: KEYWORD_FOR
Expand All @@ -485,8 +498,6 @@ tokens:
comment: "if"
- name: KEYWORD_IF_MODIFIER
comment: "if in the modifier form"
- name: KEYWORD_IN
comment: "in"
- name: KEYWORD_MODULE
comment: "module"
- name: KEYWORD_NEXT
Expand All @@ -499,8 +510,6 @@ tokens:
comment: "or"
- name: KEYWORD_REDO
comment: "redo"
- name: KEYWORD_RESCUE
comment: "rescue"
- name: KEYWORD_RESCUE_MODIFIER
comment: "rescue in the modifier form"
- name: KEYWORD_RETRY
Expand All @@ -511,8 +520,6 @@ tokens:
comment: "self"
- name: KEYWORD_SUPER
comment: "super"
- name: KEYWORD_THEN
comment: "then"
- name: KEYWORD_TRUE
comment: "true"
- name: KEYWORD_UNDEF
Expand All @@ -525,8 +532,6 @@ tokens:
comment: "until"
- name: KEYWORD_UNTIL_MODIFIER
comment: "until in the modifier form"
- name: KEYWORD_WHEN
comment: "when"
- name: KEYWORD_WHILE
comment: "while"
- name: KEYWORD_WHILE_MODIFIER
Expand Down Expand Up @@ -563,16 +568,12 @@ tokens:
comment: "-="
- name: MINUS_GREATER
comment: "->"
- name: NEWLINE
comment: "a newline character outside of other tokens"
- name: NUMBERED_REFERENCE
comment: "a numbered reference to a capture group in the previous regular expression match"
- name: PARENTHESIS_LEFT
comment: "("
- name: PARENTHESIS_LEFT_PARENTHESES
comment: "( for a parentheses node"
- name: PARENTHESIS_RIGHT
comment: ")"
- name: PERCENT
comment: "%"
- name: PERCENT_EQUAL
Expand Down Expand Up @@ -605,8 +606,6 @@ tokens:
comment: "the beginning of a regular expression"
- name: REGEXP_END
comment: "the end of a regular expression"
- name: SEMICOLON
comment: ";"
- name: SLASH
comment: "/"
- name: SLASH_EQUAL
Expand Down Expand Up @@ -651,6 +650,10 @@ tokens:
comment: "a separator between words in a list"
- name: __END__
comment: "marker for the point in the file at which the parser should stop"
- name: MISSING
comment: "a token that was expected but not found"
- name: NOT_PROVIDED
comment: "a token that was not present but it is okay"
flags:
- name: ArgumentsNodeFlags
values:
Expand Down
Loading