Skip to content

Commit 10419cc

Browse files
committed
Untag passing Regexp parsing fixtures
1 parent 8e9c232 commit 10419cc

File tree

5 files changed

+13
-29
lines changed

5 files changed

+13
-29
lines changed

spec/tags/truffle/parsing/parsing_tags.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ fails:Parsing a Rational number (with big Integer value (>= 2^64).) case is pars
3131
fails:Parsing a Rational number (with Float value) case is parsed correctly
3232
fails:Parsing a Regexp (Regexp literal in boolean context (e.g. condition in if, while, etc)) case is parsed correctly
3333
fails:Parsing a Regexp (Regexp literal in boolean context with interpolation (e.g. condition in if, while, etc)) case is parsed correctly
34-
fails:Parsing a Regexp (a literal with interpolation (with #{...})) case is parsed correctly
35-
fails:Parsing a Regexp (a literal with interpolation but without expression (#{})) case is parsed correctly
36-
fails:Parsing a Regexp (a literal with options (e.g. i, x, m, o)) case is parsed correctly
3734
fails:Parsing a Rescue keyword (backtrace optimization / disabled / when rescue section is Range (... rescue 1..3)) case is parsed correctly
3835
fails:Parsing a Rescue keyword (backtrace optimization / disabled / when rescue section is Regexp (... rescue /a/)) case is parsed correctly
3936
fails:Parsing a Rescue keyword (backtrace optimization / enabled / when rescue section is __FILE__ constant (... rescue __FILE__)) case is parsed correctly

spec/truffle/parsing/fixtures/regexps/with_interpolation.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,39 @@
11
subject: "Regexp"
22
description: "a literal with interpolation (with #{...})"
3+
yarp_specific: true # there is an extra "" StringLiteralNode with old translator
34
focused_on_node: "org.truffleruby.core.regexp.InterpolatedRegexpNode"
45
ruby: |
56
/a#{ 42 }c/
67
ast: |
78
InterpolatedRegexpNode
89
attributes:
9-
flags = 1
10+
flags = 0
1011
rubyStringLibrary = org.truffleruby.language.library.RubyStringLibrary$Cached@...
1112
children:
1213
asTruffleStringNode =
1314
TruffleStringFactory$AsTruffleStringNodeGen
1415
builderNode =
1516
InterpolatedRegexpNodeFactory$RegexpBuilderNodeGen
1617
attributes:
17-
options = RegexpOptions(kcode: NONE, kcodeDefault)
18+
options = RegexpOptions(kcode: NONE, kcodeDefault, literal)
1819
children:
1920
equalNode =
2021
TruffleStringFactory$EqualNodeGen
2122
children = [
22-
ToSNodeGen
23-
children:
24-
valueNode_ =
25-
StringLiteralNode
26-
attributes:
27-
encoding = ASCII-8BIT
28-
flags = 0
29-
tstring = ""
3023
ToSNodeGen
3124
children:
3225
valueNode_ =
3326
StringLiteralNode
3427
attributes:
3528
encoding = UTF-8
36-
flags = 0
29+
flags = 1
3730
tstring = a
3831
ToSNodeGen
3932
children:
4033
valueNode_ =
4134
IntegerFixnumLiteralNode
4235
attributes:
43-
flags = 1
36+
flags = 0
4437
value = 42
4538
ToSNodeGen
4639
children:

spec/truffle/parsing/fixtures/regexps/with_interpolation_without_expression.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,33 @@ description: "a literal with interpolation but without expression (#{})"
33
notes: >
44
An empty expression is represented as a frozen empty string with
55
(ObjectLiteralNode object = '') node.
6+
yarp_specific: true # there is an extra "" StringLiteralNode with old translator
67
focused_on_node: "org.truffleruby.core.regexp.InterpolatedRegexpNode"
78
ruby: |
89
/a#{}c/
910
ast: |
1011
InterpolatedRegexpNode
1112
attributes:
12-
flags = 1
13+
flags = 0
1314
rubyStringLibrary = org.truffleruby.language.library.RubyStringLibrary$Cached@...
1415
children:
1516
asTruffleStringNode =
1617
TruffleStringFactory$AsTruffleStringNodeGen
1718
builderNode =
1819
InterpolatedRegexpNodeFactory$RegexpBuilderNodeGen
1920
attributes:
20-
options = RegexpOptions(kcode: NONE, kcodeDefault)
21+
options = RegexpOptions(kcode: NONE, kcodeDefault, literal)
2122
children:
2223
equalNode =
2324
TruffleStringFactory$EqualNodeGen
2425
children = [
25-
ToSNodeGen
26-
children:
27-
valueNode_ =
28-
StringLiteralNode
29-
attributes:
30-
encoding = ASCII-8BIT
31-
flags = 0
32-
tstring = ""
3326
ToSNodeGen
3427
children:
3528
valueNode_ =
3629
StringLiteralNode
3730
attributes:
3831
encoding = UTF-8
39-
flags = 0
32+
flags = 1
4033
tstring = a
4134
ToSNodeGen
4235
children:

spec/truffle/parsing/fixtures/regexps/with_options.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
subject: "Regexp"
2-
description: "a literal with options (e.g. i, x, m, o)"
2+
description: "a literal with options (e.g. i, x, m)"
33
focused_on_node: "org.truffleruby.language.literal.ObjectLiteralNode"
44
ruby: |
5-
/abc/ixmo
5+
/abc/ixm
66
ast: |
77
ObjectLiteralNode
88
attributes:

spec/truffle/parsing/parsing_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@
5252

5353
overwrite = ENV['OVERWRITE_PARSING_RESULTS'] == 'true'
5454
original_parser = ENV['TRUFFLE_PARSING_USE_ORIGINAL_TRANSLATOR'] == 'true'
55+
fixtures_glob = ENV['TRUFFLE_PARSING_GLOB']
5556

5657
describe "Parsing" do
5758
require 'yaml'
5859

5960
filenames = Dir["#{__dir__}/fixtures/**/*.yaml"]
60-
# filenames = Dir["#{__dir__}/fixtures/operators/+=/**/*.yaml"] # to run a subset
61+
filenames = Dir[fixtures_glob] if fixtures_glob
6162

6263
filenames.each do |filename|
6364
yaml = YAML.safe_load_file(filename)

0 commit comments

Comments
 (0)