Skip to content

Commit 3f0a2a3

Browse files
committed
[GR-45043] Integrate YARP parser [Part 2]
PullRequest: truffleruby/3899
2 parents 099ae3f + ebfdce1 commit 3f0a2a3

File tree

130 files changed

+5807
-522
lines changed

Some content is hidden

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

130 files changed

+5807
-522
lines changed

spec/tags/truffle/parsing/parsing_tags.txt

Lines changed: 9 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,17 @@ fails:Parsing a Block (Tail expression / with explicit return inside then branch
4747
fails:Parsing a Block (a block with empty body) case is parsed correctly
4848
fails:Parsing a Block (a block with not empty body) case is parsed correctly
4949
fails:Parsing a Block (a block without parameters) case is parsed correctly
50-
fails:Parsing a Break (break operator with argument) case is parsed correctly
51-
fails:Parsing a Break (break operator with splat operator (break *a)) case is parsed correctly
5250
fails:Parsing a Break (break operator within a block) case is parsed correctly
53-
fails:Parsing a Break (break operator without argument) case is parsed correctly
5451
fails:Parsing a case expression (case expression with expression/value to match (case a when ... end)) case is parsed correctly
5552
fails:Parsing a case expression (case expression with expression to match and `else` branch (case a when ... else ... end)) case is parsed correctly
5653
fails:Parsing a case expression (case expression with expression to match and multiple values in a `when` branch (case a when a, b ... end)) case is parsed correctly
5754
fails:Parsing a case expression (case expression without expression to match (case when expr ... end)) case is parsed correctly
5855
fails:Parsing a case expression (case expression without expression to match and with `else` branch (case when expr ... else ... end)) case is parsed correctly
5956
fails:Parsing a case expression (case expression without expression to match and with multiple conditions in a `when` branch (case when a, b ... end)) case is parsed correctly
6057
fails:Parsing a class << (reopen an object singleton class) case is parsed correctly
61-
fails:Parsing a class (class definition) case is parsed correctly
62-
fails:Parsing a class (class definition with explicit lexical parent module (class Foo::Bar)) case is parsed correctly
63-
fails:Parsing a class (class definition when there are some expressions inside a body) case is parsed correctly
64-
fails:Parsing a class (class definition with inheriting a parent class) case is parsed correctly
6558
fails:Parsing a Complex number (Complex literal `bri` (without real part) where b is Float is represented as `Complext.convert(0, Rational.convert(b*100, 100))` where 100 is some power of 10 to convert b to Integer) case is parsed correctly
6659
fails:Parsing a Complex number (Complex literal `bri` (without real part) where b is Integer is represented as `Complext.convert(0, Rational.convert(b, 1))`) case is parsed correctly
6760
fails:Parsing a Complex number (Complex literal in format of a + bi is represented as `a + Complex.convert(0, b)`) case is parsed correctly
68-
fails:Parsing a Constant (reading / a constant) case is parsed correctly
69-
fails:Parsing a Constant (reading / a fully qualified constant (::A)) case is parsed correctly
70-
fails:Parsing a Constant (reading / a fully qualified constant with lexical parent (::A::B)) case is parsed correctly
71-
fails:Parsing a Constant (reading / a constant with lexical grandparent (A::B::C)) case is parsed correctly
72-
fails:Parsing a Constant (reading / a constant with lexical parent (A::B)) case is parsed correctly
73-
fails:Parsing a Constant (assigning / a constant) case is parsed correctly
74-
fails:Parsing a Constant (assigning / a fully qualified constant (::A)) case is parsed correctly
75-
fails:Parsing a Constant (assigning / a fully qualified constant with lexical parent (::A::B)) case is parsed correctly
76-
fails:Parsing a Constant (assigning / a constant with lexical grandparent (A::B::C)) case is parsed correctly
77-
fails:Parsing a Constant (assigning / a constant with lexical parent (A::B)) case is parsed correctly
7861
fails:Parsing a Def (Argument descriptors / with block (def a(&b))) case is parsed correctly
7962
fails:Parsing a Def (Argument descriptors / with double splat operator (**kw)) case is parsed correctly
8063
fails:Parsing a Def (Argument descriptors / with double splat operator without variable name (**)) case is parsed correctly
@@ -118,40 +101,15 @@ fails:Parsing a Def (Method definition with empty body) case is parsed correctly
118101
fails:Parsing a Def (Method definition with not empty body) case is parsed correctly
119102
fails:Parsing a Def (Method definition without parameters) case is parsed correctly
120103
fails:Parsing a defined? (with yield in a method body (defined? yield)) case is parsed correctly
121-
fails:Parsing a defined? (with yield in a module/class body (defined? yield)) case is parsed correctly
122-
fails:Parsing a Ensure keyword (ensure in a begin/end block) case is parsed correctly
123104
fails:Parsing a Ensure keyword (ensure in a do/end block) case is parsed correctly
124105
fails:Parsing a Ensure keyword (ensure in a method) case is parsed correctly
125-
fails:Parsing a Ensure keyword (ensure in a module) case is parsed correctly
126-
fails:Parsing a Ensure keyword (with empty body) case is parsed correctly
127-
fails:Parsing a Float (Float literal fixed-point format with underscores) case is parsed correctly
128106
fails:Parsing a For operator (for ... in ... operator) case is parsed correctly
129-
fails:Parsing a Hash (Hash literal with key-value pairs) case is parsed correctly
130-
fails:Parsing a Hash (when empty) case is parsed correctly
131-
fails:Parsing a Hash (with '=>' syntax (key => value)) case is parsed correctly
132-
fails:Parsing a Hash (Double Splat operator/there is only double splat operator (`{**{}}`)) case is parsed correctly
133-
fails:Parsing a Hash (Double Splat operator/double splat operator + key-value pairs (`{**{}, a: 1}`)) case is parsed correctly
134-
fails:Parsing a Hash (Double Splat operator/key-value pairs + double splat operator (`{a: 1, **{}}`)) case is parsed correctly
135-
fails:Parsing a Hash (Double Splat operator/key-value pairs + double splat operator + key-value pairs (`{a: 1, **{}, b: 2}`)) case is parsed correctly
136-
fails:Parsing a Hash (with String literal key) case is parsed correctly
137-
fails:Parsing a Hash (with symbol keys syntax (key: value)) case is parsed correctly
138-
fails:Parsing a Hash (with symbol keys syntax and dynamic symbol ('key': value)) case is parsed correctly
139-
fails:Parsing a Hash (with symbol keys syntax and dynamic symbol with interpolation) case is parsed correctly
140-
fails:Parsing a Instance variable (reading an instance variable) case is parsed correctly
141-
fails:Parsing a Instance variable (assigning an instance variable new value) case is parsed correctly
142-
fails:Parsing a Integer (Big Integer literal (that takes >= 64 bits)) case is parsed correctly
143-
fails:Parsing a Integer (Integer literal with binary prefix) case is parsed correctly
144-
fails:Parsing a Integer (Integer literal with explicit decimal prefix) case is parsed correctly
145-
fails:Parsing a Integer (Integer literal with hexadecimal prefix) case is parsed correctly
146-
fails:Parsing a Integer (Integer literal with octal prefix) case is parsed correctly
147-
fails:Parsing a Integer (Integer literal with underscore) case is parsed correctly
107+
fails:Parsing a Integer (when doesn't fit into Java Long (>= 64 bits)) case is parsed correctly
148108
fails:Parsing a Lambda (literal `-> () { ... }`) case is parsed correctly
149109
fails:Parsing a Local variable (in a block / reading a local variable) case is parsed correctly
150110
fails:Parsing a Local variable (in a block / assigning a local variable new value) case is parsed correctly
151111
fails:Parsing a Local variable (in a block but defined in an outer scope / reading a local variable) case is parsed correctly
152112
fails:Parsing a Local variable (in a block but defined in an outer scope / assigning a local variable new value) case is parsed correctly
153-
fails:Parsing a Local variable (reading a local variable) case is parsed correctly
154-
fails:Parsing a Local variable (assigning a local variable new value) case is parsed correctly
155113
fails:Parsing a Method call (Arguments/with a &-deconstruction to a block argument (&bar)) case is parsed correctly
156114
fails:Parsing a Method call (Arguments/with block literal argument) case is parsed correctly
157115
fails:Parsing a Method call (Arguments/with double splat operator (**kw)) case is parsed correctly
@@ -192,12 +150,6 @@ fails:Parsing a Method call (Special cases/method #attr= (property assignment))
192150
fails:Parsing a Method call (Method call with implicit receiver (`foo`)) case is parsed correctly
193151
fails:Parsing a Method call (With safe navigation operator (&.)) case is parsed correctly
194152
fails:Parsing a Method call (Without arguments and parentheses) case is parsed correctly
195-
fails:Parsing a module (module definition) case is parsed correctly
196-
fails:Parsing a module (module definition with explicit lexical parent module (module Foo::Bar)) case is parsed correctly
197-
fails:Parsing a module (module definition when there are some expressions inside a body) case is parsed correctly
198-
fails:Parsing a Next (next operator with returning value) case is parsed correctly
199-
fails:Parsing a Next (next operator with splat operator (next *a)) case is parsed correctly
200-
fails:Parsing a Next (next operator without returning value) case is parsed correctly
201153
fails:Parsing a &&= (Assign an attribute local variable (a.b &&= c)) case is parsed correctly
202154
fails:Parsing a &&= (Assign an referenced element (a[b] &&= c)) case is parsed correctly
203155
fails:Parsing a &&= (Assign an element referenced with multiple indexes (a[b, c, d] &&= e)) case is parsed correctly
@@ -253,30 +205,21 @@ fails:Parsing a Rational number (with big Integer value (>= 2^64).) case is pars
253205
fails:Parsing a Rational number (with Float value) case is parsed correctly
254206
fails:Parsing a Rational number (with Integer value) case is parsed correctly
255207
fails:Parsing a Rational number (with negative value) case is parsed correctly
256-
fails:Parsing a Redo (redo operator) case is parsed correctly
257208
fails:Parsing a Regexp (Regexp literal in boolean context (e.g. condition in if, while, etc)) case is parsed correctly
258209
fails:Parsing a Regexp (a literal) case is parsed correctly
259210
fails:Parsing a Regexp (a literal with interpolation (with #{...})) case is parsed correctly
260211
fails:Parsing a Regexp (a literal with interpolation but without expression (#{})) case is parsed correctly
261212
fails:Parsing a Regexp (a literal with options (e.g. i, x, m, o)) case is parsed correctly
262-
fails:Parsing a Rescue keyword (capturing / with an attribute) case is parsed correctly
263-
fails:Parsing a Rescue keyword (capturing / with a class variable) case is parsed correctly
264-
fails:Parsing a Rescue keyword (capturing / with a constant) case is parsed correctly
265-
fails:Parsing a Rescue keyword (capturing / with a global variable) case is parsed correctly
266-
fails:Parsing a Rescue keyword (capturing / with an instance variable) case is parsed correctly
267-
fails:Parsing a Rescue keyword (capturing / with a local variable) case is parsed correctly
268-
fails:Parsing a Rescue keyword (exceptions list / with single explicit exception class) case is parsed correctly
269-
fails:Parsing a Rescue keyword (exceptions list / with explicit multiple exception classes) case is parsed correctly
270-
fails:Parsing a Rescue keyword (exceptions list / with a splat operator) case is parsed correctly
271-
fails:Parsing a Rescue keyword (exceptions list / with a splat operator, followed and preceded by list elements) case is parsed correctly
272-
fails:Parsing a Rescue keyword (exceptions list / without explicit exceptions list) case is parsed correctly
273-
fails:Parsing a Rescue keyword (rescue in a begin/end block) case is parsed correctly
213+
fails:Parsing a Rescue keyword (backtrace optimization / disabled / when rescue section is Range (... rescue 1..3)) case is parsed correctly
214+
fails:Parsing a Rescue keyword (backtrace optimization / disabled / when rescue section is Regexp (... rescue /a/)) case is parsed correctly
215+
fails:Parsing a Rescue keyword (backtrace optimization / enabled / when rescue section is __FILE__ constant (... rescue __FILE__)) case is parsed correctly
216+
fails:Parsing a Rescue keyword (backtrace optimization / enabled / when rescue section is local variable defined in outer scope (... rescue a)) case is parsed correctly
274217
fails:Parsing a Rescue keyword (rescue in a do/end block) case is parsed correctly
275218
fails:Parsing a Rescue keyword (rescue in a method) case is parsed correctly
276-
fails:Parsing a Rescue keyword (rescue in a module) case is parsed correctly
277-
fails:Parsing a Rescue keyword (rescue with else branch) case is parsed correctly
278-
fails:Parsing a Rescue keyword (rescue with empty else branch) case is parsed correctly
279-
fails:Parsing a Rescue keyword (with empty body) case is parsed correctly
219+
fails:Parsing a Rescue keyword (modifier / backtrace optimization / disabled / when rescue section is Range (... rescue 1..3)) case is parsed correctly
220+
fails:Parsing a Rescue keyword (modifier / backtrace optimization / disabled / when rescue section is Regexp (... rescue /a/)) case is parsed correctly
221+
fails:Parsing a Rescue keyword (modifier / backtrace optimization / enabled / when rescue section is __FILE__ constant (... rescue __FILE__)) case is parsed correctly
222+
fails:Parsing a Rescue keyword (modifier / backtrace optimization / enabled / when rescue section is local variable defined in outer scope (... rescue a)) case is parsed correctly
280223
fails:Parsing a Rescue keyword (with exception and variable) case is parsed correctly
281224
fails:Parsing a Rescue keyword (with multiple rescue branches) case is parsed correctly
282225
fails:Parsing a Rescue keyword (without exception but with a variable) case is parsed correctly
@@ -290,19 +233,12 @@ fails:Parsing a Return (return operator in a method (with a value)) case is pars
290233
fails:Parsing a Return (return operator in a method without value) case is parsed correctly
291234
fails:Parsing a Return (return operator with splat operator (return *a)) case is parsed correctly
292235
fails:Parsing a Sequence of expressions () case is parsed correctly
293-
fails:Parsing a String (Backtick literal (`echo 1`) to execute a shell command) case is parsed correctly
294-
fails:Parsing a String (Backtick literal (`echo 1`) with interpolation (#{...})) case is parsed correctly
295-
fails:Parsing a String (Backtick literal (`echo 1`) with interpolation without expression (#{})) case is parsed correctly
296236
fails:Parsing a String (Frozen literal) case is parsed correctly
297237
fails:Parsing a String (Literal with interpolation when when expressions are % String literals) case is parsed correctly
298238
fails:Parsing a String (Literal with interpolation when expressions are Strings) case is parsed correctly
299239
fails:Parsing a Symbol (Literal with interpolation when expressions are % String literals) case is parsed correctly
300240
fails:Parsing a Symbol (Literal with interpolation when expressions are Strings) case is parsed correctly
301241
fails:Parsing a Undef (with multiple Symbols) case is parsed correctly
302-
fails:Parsing a Until (until loop operator) case is parsed correctly
303-
fails:Parsing a Until (until modifier (... until())) case is parsed correctly
304-
fails:Parsing a While (while loop operator) case is parsed correctly
305-
fails:Parsing a While (while modifier (... while())) case is parsed correctly
306242
fails:Parsing a Yield (yield operator with arguments) case is parsed correctly
307243
fails:Parsing a Yield (yield operator with keyword arguments) case is parsed correctly
308244
fails:Parsing a Yield (yield operator with double splat operator (yield **a)) case is parsed correctly
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
subject: "Break"
2+
description: "break operator with multiple arguments"
3+
focused_on_node: "org.truffleruby.language.control.BreakNode"
4+
ruby: |
5+
while true
6+
break 42, 100500
7+
end
8+
ast: |
9+
BreakNode
10+
attributes:
11+
breakID = org.truffleruby.language.control.BreakID@...
12+
flags = 1
13+
ignoreMarker = true
14+
children:
15+
child =
16+
ArrayLiteralNode$UninitialisedArrayLiteralNode
17+
attributes:
18+
flags = 0
19+
language = org.truffleruby.RubyLanguage@...
20+
children:
21+
values = [
22+
IntegerFixnumLiteralNode
23+
attributes:
24+
flags = 0
25+
value = 42
26+
IntegerFixnumLiteralNode
27+
attributes:
28+
flags = 0
29+
value = 100500
30+
]

0 commit comments

Comments
 (0)