Commit graph

555 commits

Author SHA1 Message Date
Kevin Newton
ca5b458044 [PRISM] Match CRuby line semantics for evstr 2024-05-20 11:28:53 -04:00
Nobuyoshi Nakada
8c0b57d3ee
rb_enc_compile_warn and rb_enc_compile_warning are printf format 2024-05-19 22:15:59 +09:00
Nobuyoshi Nakada
b47533f67b
Remove rb_bug after COMPILE_ERROR
Fix test failures since 7afc16aa48.
Why crash after reported compile error properly.
2024-05-19 20:45:47 +09:00
Kevin Newton
cce7c25a42 [PRISM] Enable TestRequire 2024-05-17 16:42:14 -04:00
Kevin Newton
c60cdbdc98 [PRISM] Emit END event for modules 2024-05-17 11:23:23 -04:00
Kevin Newton
4ba0579da6 [PRISM] Enable TestSyntax#test_error_message_encoding 2024-05-17 10:33:42 -04:00
Kevin Newton
77b6c980b2 [PRISM] Handle operator->binary_operator rename 2024-05-10 11:47:48 -04:00
Kevin Newton
ba062a6231 [PRISM] Use correct warning encoding 2024-05-08 08:12:17 -04:00
Kevin Newton
481e16d58b [PRISM] Support for compiling ractor constant path writes 2024-05-06 19:06:13 -04:00
Kevin Newton
eeba158109 [PRISM] Support for compiling ractor constant writes 2024-05-06 19:06:13 -04:00
Kevin Newton
0948b6a592 [PRISM] Use new constant path structure 2024-05-03 11:11:57 -04:00
Kevin Newton
5409661fe6 Mark the first string element of a regexp as binary if US-ASCII 2024-05-02 22:46:09 -04:00
Kevin Newton
e34c131ce8 [PRISM] Disallow redundant returns from being line events 2024-05-02 15:16:15 -04:00
Kevin Newton
398453c3c0 [PRISM] Fix param names for repeated splats 2024-05-02 11:27:05 -04:00
jinroq
a3726c028d Fixed missing support for d75bbba255. 2024-05-02 05:36:14 -04:00
Kevin Newton
0fa09c5729 [PRISM] Correct encoding for interpolated string literals in regexp 2024-05-01 12:34:29 -04:00
Kevin Newton
b6fa18fbe9 [PRISM] Properly precheck regexp for encoding issues 2024-05-01 12:34:29 -04:00
Kevin Newton
1b8650964b [PRISM] Support interpolated regexp with encoding modifiers 2024-05-01 12:34:29 -04:00
Nobuyoshi Nakada
f4c6479eea
Fix xfree
Pointers allocated with `ruby_xmalloc` (`ALLOC` macro) must be freed
with `ruby_xfree`.
2024-05-01 22:01:36 +09:00
Kevin Newton
d75bbba255 [PRISM] Remove false positive compile warnings for branch coverage 2024-04-29 13:28:15 -04:00
Kevin Newton
46480e3042 [PRISM] Use redundant return flag 2024-04-26 15:16:58 -04:00
Kevin Newton
9aecff2530 [PRISM] Fix up if condition branch coverage location 2024-04-26 12:25:45 -04:00
Kevin Newton
c46e32e342 [PRISM] Fix up branch coverage for &. with block 2024-04-26 12:25:45 -04:00
Kevin Newton
d06bbafd3f [PRISM] Enable branch coverage for if/unless conditionals 2024-04-26 12:25:45 -04:00
Kevin Newton
881c450135 [PRISM] Enable branch coverage for while/until loops 2024-04-26 12:25:45 -04:00
Kevin Newton
43076bf9d1 [PRISM] Enable branch coverage for case pattern matching 2024-04-26 12:25:45 -04:00
Kevin Newton
e5bd4c78b2 [PRISM] Enable branch coverage for case 2024-04-26 12:25:45 -04:00
Kevin Newton
235a3f3b7c [PRISM] Enable branch coverage for &. 2024-04-26 12:25:45 -04:00
Kevin Newton
af24ba4034 [PRISM] Raise LoadError when file cannot be read 2024-04-25 14:59:48 -04:00
Kevin Newton
7baecc2e36 [PRISM] Emit parse warnings before raising syntax errors 2024-04-12 17:46:31 -04:00
Takashi Kokubun
971b552735 [PRISM] Suppress compiler warnings
../prism_compile.c: In function ‘pm_compile_node’:
../compile.c:583:24: warning: ‘retry_end_l’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  583 |     anchor->last->next = elem;
      |     ~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from ../compile.c:14256:
../prism_compile.c:5796:16: note: ‘retry_end_l’ was declared here
 5796 |         LABEL *retry_end_l;
      |                ^~~~~~~~~~~
../compile.c:255:42: warning: ‘retry_label’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  255 | #define LABEL_REF(label) ((label)->refcnt++)
      |                                          ^~
In file included from ../compile.c:14256:
../prism_compile.c:5795:16: note: ‘retry_label’ was declared here
 5795 |         LABEL *retry_label;
      |                ^~~~~~~~~~~
../prism_compile.c:5919:52: warning: ‘previous_block’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 5919 |             ISEQ_COMPILE_DATA(iseq)->current_block = previous_block;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
2024-04-11 17:31:28 -07:00
Kevin Newton
842f151d79 [PRISM] Enable more passing tests 2024-04-11 15:47:30 -04:00
Kevin Newton
58f93eec18 [PRISM] Fix break in super block 2024-04-11 14:39:04 -04:00
Kevin Newton
bb5ed8b3df [PRISM] Fix flags on local variable operator write nodes 2024-04-11 12:18:51 -04:00
Jean Boussier
db0cf1aef9 prism_compile.c: use rb_enc_interned_str to reduce allocations
The `rb_fstring(rb_enc_str_new())` pattern is inefficient because:

- It passes a mutable string to `rb_fstring` so if it has to be interned it will first be duped.
- It an equivalent interned string already exists, we allocated the string for nothing.

With `rb_enc_interned_str` we either directly get the pre-existing string with 0 allocations,
or efficiently directly intern the one we create without first duping it.
2024-04-11 14:48:30 +02:00
Jean Boussier
9183101aa7 prism_compile.c: X_STRING should be frozen
The backtick method recieves a frozen string unless it is interpolated.

Otherwise the string held in the ISeq could be mutated by a custom
backtick method.
2024-04-11 08:08:30 -04:00
Kevin Newton
0aa1d61ab9 [PRISM] Ensure unfrozen when interpolation is present in string literal 2024-04-04 15:27:51 -04:00
Kevin Newton
3efc1c36f2 [PRISM] Add CLASS and END tracepoint events 2024-04-04 15:27:51 -04:00
Kevin Newton
6748526edd [PRISM] Fix location of ensure iseqs 2024-04-04 15:27:51 -04:00
Kevin Newton
0f742a33fb [PRISM] Remove trailing spaces 2024-04-04 14:14:55 -04:00
Kevin Newton
ed99f03a38 [PRISM] Consistent style in prism_compile.c 2024-04-04 14:14:55 -04:00
Kevin Newton
457abb2c47 [PRISM] Remove pm_line_node_t, consolidate all line number handling 2024-04-04 14:14:55 -04:00
Kevin Newton
338d10f9df [PRISM] Finish removing dummy_line_node usage in pm_compile_node 2024-04-04 14:14:55 -04:00
Kevin Newton
895e777227 [PRISM] Remove dummy_line_node creation in pm_compile_node 2024-04-04 14:14:55 -04:00
Kevin Newton
0cf00ca7aa [PRISM] Remove specialized macros that used dummy_line_node 2024-04-04 14:14:55 -04:00
Kevin Newton
b360b4ce3e [PRISM] Remove dummy_line_node usage from get/set local instructions 2024-04-04 14:14:55 -04:00
Kevin Newton
cb5dbca82e [PRISM] Remove dummy_line_node usage from remaining nodes 2024-04-04 14:14:55 -04:00
Kevin Newton
8bf368d183 [PRISM] Remove dummy_line_node usage from ensure and flip flop nodes 2024-04-04 14:14:55 -04:00
Kevin Newton
cc248706dd [PRISM] Remove dummy_line_node usage from false and else node 2024-04-04 14:14:55 -04:00
Kevin Newton
829ca8c4e3 [PRISM] Remove dummy_line_node usage from embedded nodes 2024-04-04 14:14:55 -04:00