Commit graph

29 commits

Author SHA1 Message Date
Kevin Newton
4cf4cad4ab [ruby/prism] Turn off unescape tests for Ruby >= 3.4.0
f982769314
2024-12-27 01:26:54 +00:00
Kevin Newton
4d8c9c1310 [ruby/prism] Handle escaped characters after controls
Fixes [Bug #20986]

fd0c563e9e
2024-12-26 22:35:28 +00:00
Kevin Newton
3eb42054d9 [ruby/prism] Pass Unicode escapes on to onigmo
When we encounter an invalid unicode escape within a regular
expression, we now pass that error on to Onigmo as if it didn't
exist in the parser (which matches the upstream parser's behavior).

We do this because there are tests that specify that you are
allowed to have invalid Unicode escapes if they are within the
context of a regular expression comment for a regular expression
in extended mode. That looks like:

    /# \u /x

Note that this _only_ applies to Unicode escapes (as opposed to
applying to hex or meta/control escapes as well). Importantly it
also only applies if the regular expression is terminated. An
unterminated regular expression will still get error handling done
in the parser. That would look like:

    /# \u

that would result in the same error handling we have today.

fb98034806
2024-08-23 19:18:14 +00:00
Kevin Newton
4558abec02 [ruby/prism] Disallow unescape test on FFI backend
32277722d4
2024-05-30 19:36:40 +00:00
Kevin Newton
72452f4387 [ruby/prism] Tests overhaul
6f886be0a4
2024-05-30 15:18:20 -04:00
Kevin Newton
41f8ae1ffd [ruby/prism] Mark errors for invalid symbols
661884c4a3
2024-05-01 16:43:05 +00:00
Kevin Newton
609bbad15d [ruby/prism] Fix up regexp memory leaks
4dc58a533a
2024-03-08 18:48:55 +00:00
Kevin Newton
76e11595e2 [ruby/prism] Fix up tilde heredoc line continuations
15e74b2f65
2024-03-07 20:25:24 +00:00
Kevin Newton
11e946da2f [ruby/prism] Fix up PR failings
11255f636e
2023-10-13 15:31:30 -04:00
Kevin Newton
d06523bc52 [ruby/prism] Remove now-defunct semantic_field from nodes
c82a9dad64
2023-10-13 15:31:30 -04:00
Kevin Newton
10e7e5bc8e [ruby/prism] Refactor unescape test to simplify
4392775898
2023-10-13 15:31:30 -04:00
Kevin Newton
fa76cddc5b [ruby/prism] Properly handle unescaping in regexp
abf9fd6863
2023-10-13 15:31:30 -04:00
Kevin Newton
e4f1c06a9b [ruby/prism] Use current_string to handle :" symbols
eedeec8f9a
2023-10-13 15:31:30 -04:00
Kevin Newton
a1de762966 [ruby/prism] Use current_string for :' symbols
fadb5be520
2023-10-13 15:31:30 -04:00
Kevin Newton
8bf0d381dc [ruby/prism] Use current_string for %s symbol literals
52504f8911
2023-10-13 15:31:30 -04:00
Kevin Newton
d0614b5254 [ruby/prism] Split up lines in tilde heredocs
21fad0c2ce
2023-10-13 15:31:30 -04:00
Kevin Newton
d6424453db [ruby/prism] Enable remaining heredoc unescape tests
c7ea4941c5
2023-10-13 15:31:30 -04:00
Kevin Newton
da47a71325 [ruby/prism] Use current_string for x string escape sequences
66ce9280bb
2023-10-13 15:31:30 -04:00
Kevin Newton
ef1e5b65dc [ruby/prism] Use current_string to handle escapes in string literals
d912d48104
2023-10-13 15:31:30 -04:00
Kevin Newton
f64a0434dd [ruby/prism] Use current_string to handle %I
831d5f4b45
2023-10-13 15:31:30 -04:00
Kevin Newton
5fc34f1cde [ruby/prism] Use current_string for handling %W lists
edb1674725
2023-10-13 15:31:30 -04:00
Kevin Newton
3c743445d7 [ruby/prism] Use current_string to handle %i escapes
9c90d0a777
2023-10-13 15:31:30 -04:00
Kevin Newton
4e3013f42d [ruby/prism] Use current_string to handle %w escapes
b8420ea7ae
2023-10-13 15:31:30 -04:00
Kevin Newton
3dba3ab47d [ruby/prism] Strip out old char unescaping
27ca207ab3
2023-10-13 15:31:30 -04:00
Kevin Newton
dd3986876a [ruby/prism] Handle remaining escape sequences for character literals
ba33607034
2023-10-13 15:31:30 -04:00
Kevin Newton
e179e62bd2 [ruby/prism] Skip tests that are currently failing
23b2336148
2023-10-13 15:31:30 -04:00
Kevin Newton
8e223366fc [ruby/prism] More thoroughly test unescapes
e86196dde6
2023-10-13 15:31:30 -04:00
Kevin Newton
4f73a7c2f7 Sync to prism rename commits 2023-09-27 13:57:38 -04:00
Kevin Newton
8ab56869a6 Rename YARP filepaths to prism filepaths 2023-09-27 13:57:38 -04:00
Renamed from test/yarp/unescape_test.rb (Browse further)