Skip to content

Commit 5de3856

Browse files
committed
[GR-45043] Import Prism
PullRequest: truffleruby/4222
2 parents 36a412c + c769938 commit 5de3856

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+6690
-1705
lines changed

spec/ruby/language/regexp/back-references_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
$10.should == "0"
2323
end
2424

25+
it "returns nil for numbered variable with too large index" do
26+
-> {
27+
eval(<<~CODE).should == nil
28+
"a" =~ /(.)/
29+
eval('$4294967296')
30+
CODE
31+
}.should complain(/warning: ('|`)\$4294967296' is too big for a number variable, always nil/)
32+
end
33+
2534
it "will not clobber capture variables across threads" do
2635
cap1, cap2, cap3 = nil
2736
"foo" =~ /(o+)/

spec/tags/language/hash_tags.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
fails:The ** operator makes a caller-side copy when calling a method taking a positional Hash
22
fails:Hash literal checks duplicated keys on initialization
33
fails:Hash literal checks duplicated float keys on initialization
4-
fails(https://github.com/ruby/prism/issues/2115):Hash literal expands an '**{}' or '**obj' element with the last key/value pair taking precedence
5-
fails(https://github.com/ruby/prism/issues/2115):Hash literal expands an '**{}' and warns when finding an additional duplicate key afterwards
6-
fails(https://github.com/ruby/prism/issues/2115):Hash literal merges multiple nested '**obj' in Hash literals
4+
fails(https://github.com/ruby/prism/issues/2005):Hash literal expands an '**{}' or '**obj' element with the last key/value pair taking precedence
5+
fails(https://github.com/ruby/prism/issues/2005):Hash literal expands an '**{}' and warns when finding an additional duplicate key afterwards
6+
fails(https://github.com/ruby/prism/issues/2005):Hash literal merges multiple nested '**obj' in Hash literals
77
fails(https://github.com/ruby/prism/issues/2129):Hash literal raises an EncodingError at parse time when Symbol key with invalid bytes
88
fails(https://github.com/ruby/prism/issues/2129):Hash literal raises an EncodingError at parse time when Symbol key with invalid bytes and 'key: value' syntax used
99
fails:The ** operator makes a copy when calling a method taking a positional Hash

spec/tags/language/heredoc_tags.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
fails:Heredoc string prints a warning if quoted HEREDOC identifier is ending not on same line
2-
fails(https://github.com/ruby/prism/issues/2074):Heredoc string allows HEREDOC with <<~'identifier', no interpolation, with backslash

spec/tags/language/regexp_tags.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

spec/tags/language/source_encoding_tags.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ slow:Source files encoded in UTF-16 LE with a BOM are invalid because they conta
55
slow:Source files encoded in UTF-16 BE without a BOM are parsed as empty because they contain a NUL byte before the encoding comment
66
slow:Source files encoded in UTF-16 BE with a BOM are invalid because they contain an invalid UTF-8 sequence before the encoding comment
77
slow:Source files encoded in UTF-16 LE without a BOM are parsed as empty because they contain a NUL byte before the encoding comment
8-
fails(https://github.com/ruby/prism/issues/2166):Source files encoded in UTF-16 LE with a BOM are invalid because they contain an invalid UTF-8 sequence before the encoding comment
9-
fails(https://github.com/ruby/prism/issues/2166):Source files encoded in UTF-16 BE with a BOM are invalid because they contain an invalid UTF-8 sequence before the encoding comment

spec/tags/truffle/parsing/parsing_tags.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

spec/truffle/parsing/fixtures/regexps/encoding/when_non_ascii_characters.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ast: |
1010
ObjectLiteralNode
1111
attributes:
1212
flags = 1
13-
object = RubyRegexp(source = abc \xFF, options = RegexpOptions(kcode: NONE, fixed, kcodeDefault, literal), encoding = ASCII-8BIT)
13+
object = RubyRegexp(source = abc \xFF, options = RegexpOptions(kcode: NONE, fixed, kcodeDefault, literal), encoding = ASCII-8BIT)
14+
sourceCharIndex = 21
15+
sourceLength = 10

spec/truffle/parsing/fixtures/regexps/encoding_in_boolean_context/when_non_ascii_characters.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ ast: |
2121
methodName = "=~"
2222
notEmptyKeywordsProfile = false
2323
notRuby2KeywordsHashProfile = false
24+
sourceCharIndex = 21
25+
sourceLength = 10
2426
children:
2527
arguments = [
2628
ReadGlobalVariableNodeGen
2729
attributes:
2830
flags = 0
2931
name = "$_"
32+
sourceCharIndex = -1
33+
sourceLength = 0
3034
children:
3135
lookupGlobalVariableStorageNode =
3236
LookupGlobalVariableStorageNodeGen
@@ -38,4 +42,6 @@ ast: |
3842
ObjectLiteralNode
3943
attributes:
4044
flags = 0
41-
object = RubyRegexp(source = abc \xFF, options = RegexpOptions(kcode: NONE, fixed, kcodeDefault, literal), encoding = ASCII-8BIT)
45+
object = RubyRegexp(source = abc \xFF, options = RegexpOptions(kcode: NONE, fixed, kcodeDefault, literal), encoding = ASCII-8BIT)
46+
sourceCharIndex = 21
47+
sourceLength = 10

spec/truffle/parsing/fixtures/strings/concatenated_literal.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ast: |
77
StringLiteralNode
88
attributes:
99
encoding = UTF-8
10-
flags = 0
10+
flags = 1
1111
sourceCharIndex = 0
1212
sourceLength = 11
1313
tstring = foobar
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
subject: "String"
2+
description: "2 string literals concatenated at parse/translation time / with frozen_string_literal: true"
3+
notes: >
4+
Result string should be frozen and represented as a FrozenStringLiteralNode node
5+
focused_on_node: "org.truffleruby.language.literal.FrozenStringLiteralNode"
6+
ruby: |
7+
# frozen_string_literal: true
8+
"foo" "bar"
9+
ast: |
10+
FrozenStringLiteralNode
11+
attributes:
12+
definition = "expression" (ASCII-8BIT)
13+
flags = 1
14+
frozenString = "foobar" (UTF-8)
15+
sourceCharIndex = 30
16+
sourceLength = 11

0 commit comments

Comments
 (0)