prism 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/ext/prism/extension.h +1 -1
- data/include/prism/defines.h +18 -0
- data/include/prism/util/pm_memchr.h +1 -1
- data/include/prism/version.h +2 -2
- data/lib/prism/serialize.rb +1 -1
- data/prism.gemspec +1 -1
- data/src/diagnostic.c +2 -0
- data/src/prism.c +4 -1
- data/src/util/pm_memchr.c +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c783657a881bf48ea7f582fd8460ce7230ffc142a67d6eab53f06c5878d2739
|
|
4
|
+
data.tar.gz: 761e009ead12f8984342f4aa44a8efb8e2c312b1b19527ba9e6399ba8a9990aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 247eb5ba72e15a0bf3136a45582218c232cb300f34b33304bbc63dcfa2ab8fbd728192aff1f63de3b6d2bf23a18afb1711460e28f8e5ce1cc478f5af6e37b205
|
|
7
|
+
data.tar.gz: f0ee65d2c2ff74a3bc9fe0709177467fafdaf0a79aa0c43e8e5f82bfc17c855d3546aa6442d45de55dcea4fe06e567879e60d8a23448a151a1e9d539ccfbd1fd
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.8.2] - 2026-10-21
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Fix build errors with C23 qualifier-preserving `memchr`.
|
|
14
|
+
- Do not warn for ambiguous `/` when targeting Ruby 4.1.
|
|
15
|
+
- Fix array-bounds warnings with newer GCC.
|
|
16
|
+
|
|
9
17
|
## [1.8.1] - 2026-03-16
|
|
10
18
|
|
|
11
19
|
### Changed
|
|
@@ -740,7 +748,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
|
740
748
|
|
|
741
749
|
- 🎉 Initial release! 🎉
|
|
742
750
|
|
|
743
|
-
[unreleased]: https://github.com/ruby/prism/compare/v1.8.
|
|
751
|
+
[unreleased]: https://github.com/ruby/prism/compare/v1.8.2...HEAD
|
|
752
|
+
[1.8.2]: https://github.com/ruby/prism/compare/v1.8.1...v1.8.2
|
|
744
753
|
[1.8.1]: https://github.com/ruby/prism/compare/v1.8.0...v1.8.1
|
|
745
754
|
[1.8.0]: https://github.com/ruby/prism/compare/v1.7.0...v1.8.0
|
|
746
755
|
[1.7.0]: https://github.com/ruby/prism/compare/v1.6.0...v1.7.0
|
data/ext/prism/extension.h
CHANGED
data/include/prism/defines.h
CHANGED
|
@@ -257,4 +257,22 @@
|
|
|
257
257
|
#define PRISM_FALLTHROUGH
|
|
258
258
|
#endif
|
|
259
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Tell the compiler that the given expression can be assumed to be true. Unlike
|
|
262
|
+
* assert, this emits no runtime check — it only feeds the optimizer's value
|
|
263
|
+
* range analysis so it can prune impossible paths. Use it to communicate an
|
|
264
|
+
* invariant the caller guarantees but that the compiler cannot otherwise prove.
|
|
265
|
+
*/
|
|
266
|
+
#if defined(__clang__)
|
|
267
|
+
#define PRISM_ASSUME(expr_) __builtin_assume(expr_)
|
|
268
|
+
#elif defined(_MSC_VER)
|
|
269
|
+
#define PRISM_ASSUME(expr_) __assume(expr_)
|
|
270
|
+
#elif defined(__GNUC__) && (__GNUC__ >= 13)
|
|
271
|
+
#define PRISM_ASSUME(expr_) __attribute__((assume(expr_)))
|
|
272
|
+
#elif defined(__GNUC__)
|
|
273
|
+
#define PRISM_ASSUME(expr_) ((expr_) ? (void) 0 : __builtin_unreachable())
|
|
274
|
+
#else
|
|
275
|
+
#define PRISM_ASSUME(expr_) ((void) 0)
|
|
276
|
+
#endif
|
|
277
|
+
|
|
260
278
|
#endif
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
* @return A pointer to the first occurrence of the character in the source
|
|
25
25
|
* string, or NULL if no such character exists.
|
|
26
26
|
*/
|
|
27
|
-
void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding);
|
|
27
|
+
const void * pm_memchr(const void *source, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding);
|
|
28
28
|
|
|
29
29
|
#endif
|
data/include/prism/version.h
CHANGED
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* The patch version of the Prism library as an int.
|
|
21
21
|
*/
|
|
22
|
-
#define PRISM_VERSION_PATCH
|
|
22
|
+
#define PRISM_VERSION_PATCH 2
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The version of the Prism library as a constant string.
|
|
26
26
|
*/
|
|
27
|
-
#define PRISM_VERSION "1.8.
|
|
27
|
+
#define PRISM_VERSION "1.8.2"
|
|
28
28
|
|
|
29
29
|
#endif
|
data/lib/prism/serialize.rb
CHANGED
data/prism.gemspec
CHANGED
data/src/diagnostic.c
CHANGED
|
@@ -761,6 +761,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
|
|
|
761
761
|
static inline const char *
|
|
762
762
|
pm_diagnostic_message(pm_diagnostic_id_t diag_id) {
|
|
763
763
|
assert(diag_id < PM_DIAGNOSTIC_ID_MAX);
|
|
764
|
+
PRISM_ASSUME(diag_id < PM_DIAGNOSTIC_ID_MAX);
|
|
764
765
|
|
|
765
766
|
const char *message = diagnostic_messages[diag_id].message;
|
|
766
767
|
assert(message);
|
|
@@ -771,6 +772,7 @@ pm_diagnostic_message(pm_diagnostic_id_t diag_id) {
|
|
|
771
772
|
static inline uint8_t
|
|
772
773
|
pm_diagnostic_level(pm_diagnostic_id_t diag_id) {
|
|
773
774
|
assert(diag_id < PM_DIAGNOSTIC_ID_MAX);
|
|
775
|
+
PRISM_ASSUME(diag_id < PM_DIAGNOSTIC_ID_MAX);
|
|
774
776
|
|
|
775
777
|
return (uint8_t) diagnostic_messages[diag_id].level;
|
|
776
778
|
}
|
data/src/prism.c
CHANGED
|
@@ -10774,7 +10774,10 @@ parser_lex(pm_parser_t *parser) {
|
|
|
10774
10774
|
}
|
|
10775
10775
|
|
|
10776
10776
|
if (lex_state_spcarg_p(parser, space_seen)) {
|
|
10777
|
-
|
|
10777
|
+
// https://bugs.ruby-lang.org/issues/21994
|
|
10778
|
+
if (parser->version <= PM_OPTIONS_VERSION_CRUBY_4_0) {
|
|
10779
|
+
pm_parser_warn_token(parser, &parser->current, PM_WARN_AMBIGUOUS_SLASH);
|
|
10780
|
+
}
|
|
10778
10781
|
lex_mode_push_regexp(parser, '\0', '/');
|
|
10779
10782
|
LEX(PM_TOKEN_REGEXP_BEGIN);
|
|
10780
10783
|
}
|
data/src/util/pm_memchr.c
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* we need to search for a character in a buffer that could be the trailing byte
|
|
8
8
|
* of a multibyte character.
|
|
9
9
|
*/
|
|
10
|
-
void *
|
|
10
|
+
const void *
|
|
11
11
|
pm_memchr(const void *memory, int character, size_t number, bool encoding_changed, const pm_encoding_t *encoding) {
|
|
12
12
|
if (encoding_changed && encoding->multibyte && character >= PRISM_MEMCHR_TRAILING_BYTE_MINIMUM) {
|
|
13
13
|
const uint8_t *source = (const uint8_t *) memory;
|