-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GR-45043] Integrate YARP parser [Part 7]
PullRequest: truffleruby/4094
- Loading branch information
Showing
71 changed files
with
8,822 additions
and
2,247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
fails:Parsing a BEGIN block (BEGIN { ... }) case is parsed correctly | ||
fails:Parsing a END block (END { ... }) case is parsed correctly | ||
fails:Parsing a For operator (for ... in ... operator) case is parsed correctly | ||
# Not supported yet by Prism | ||
# See https://github.com/ruby/prism/issues/1997 | ||
fails:Parsing a Regexp (encoding / when there are non-ASCII characters in a literal) case is parsed correctly | ||
fails:Parsing a Regexp (encoding in boolean context / when there are non-ASCII characters in a literal) case is parsed correctly |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
subject: "BEGIN block" | ||
description: "BEGIN { ... }" | ||
notes: > | ||
Put content of the BEGIN block at the beginning of the program. | ||
So actual sequence of expressions is: | ||
```ruby | ||
a | ||
b | ||
``` | ||
focused_on_node: "org.truffleruby.language.RubyTopLevelRootNode" | ||
ruby: | | ||
b | ||
BEGIN { | ||
a | ||
} | ||
ast: | | ||
RubyTopLevelRootNode | ||
attributes: | ||
arityForCheck = Arity{preRequired = 0, optional = 0, hasRest = true, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false} | ||
callTarget = <top (required)> | ||
checkArityProfile = false | ||
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_} | ||
instrumentationBits = 0 | ||
keywordArguments = false | ||
localReturnProfile = false | ||
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked] | ||
matchingReturnProfile = false | ||
nextProfile = false | ||
nonMatchingReturnProfile = false | ||
polyglotRef = org.truffleruby.RubyLanguage@... | ||
retryProfile = false | ||
returnID = org.truffleruby.language.control.ReturnID@... | ||
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <top (required)>, blockDepth = 0, parseName = <top (required)>, notes = null, argumentDescriptors = null) | ||
split = HEURISTIC | ||
children: | ||
body = | ||
SequenceNode | ||
attributes: | ||
flags = 12 | ||
children: | ||
body = [ | ||
WriteLocalVariableNode | ||
attributes: | ||
flags = 0 | ||
frameSlot = 0 # (self) | ||
children: | ||
valueNode = | ||
ProfileArgumentNodeGen | ||
attributes: | ||
flags = 0 | ||
children: | ||
childNode_ = | ||
ReadSelfNode | ||
attributes: | ||
flags = 0 | ||
RubyCallNode | ||
attributes: | ||
descriptor = NoKeywordArgumentsDescriptor | ||
dispatchConfig = PRIVATE | ||
emptyKeywordsProfile = false | ||
flags = 1 | ||
isAttrAssign = false | ||
isSafeNavigation = false | ||
isSplatted = false | ||
isVCall = true | ||
lastArgIsNotHashProfile = false | ||
methodName = "a" | ||
notEmptyKeywordsProfile = false | ||
notRuby2KeywordsHashProfile = false | ||
children: | ||
receiver = | ||
SelfNode | ||
attributes: | ||
flags = 0 | ||
RubyCallNode | ||
attributes: | ||
descriptor = NoKeywordArgumentsDescriptor | ||
dispatchConfig = PRIVATE | ||
emptyKeywordsProfile = false | ||
flags = 1 | ||
isAttrAssign = false | ||
isSafeNavigation = false | ||
isSplatted = false | ||
isVCall = true | ||
lastArgIsNotHashProfile = false | ||
methodName = "b" | ||
notEmptyKeywordsProfile = false | ||
notRuby2KeywordsHashProfile = false | ||
children: | ||
receiver = | ||
SelfNode | ||
attributes: | ||
flags = 0 | ||
] |
125 changes: 125 additions & 0 deletions
125
spec/truffle/parsing/fixtures/BEGIN/when_multiple_occurrences.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
subject: "BEGIN block" | ||
description: "when multiple occurrences in a program" | ||
notes: > | ||
Put content of the BEGIN blocks in order they are located in a program. | ||
So sequence of expressions is: | ||
```ruby | ||
a | ||
b | ||
c | ||
``` | ||
focused_on_node: "org.truffleruby.language.RubyTopLevelRootNode" | ||
ruby: | | ||
BEGIN { | ||
a | ||
} | ||
BEGIN { | ||
b | ||
} | ||
BEGIN { | ||
c | ||
} | ||
ast: | | ||
RubyTopLevelRootNode | ||
attributes: | ||
arityForCheck = Arity{preRequired = 0, optional = 0, hasRest = true, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false} | ||
callTarget = <top (required)> | ||
checkArityProfile = false | ||
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_} | ||
instrumentationBits = 0 | ||
keywordArguments = false | ||
localReturnProfile = false | ||
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked] | ||
matchingReturnProfile = false | ||
nextProfile = false | ||
nonMatchingReturnProfile = false | ||
polyglotRef = org.truffleruby.RubyLanguage@... | ||
retryProfile = false | ||
returnID = org.truffleruby.language.control.ReturnID@... | ||
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = false}, originName = <top (required)>, blockDepth = 0, parseName = <top (required)>, notes = null, argumentDescriptors = null) | ||
split = HEURISTIC | ||
children: | ||
body = | ||
SequenceNode | ||
attributes: | ||
flags = 12 | ||
children: | ||
body = [ | ||
WriteLocalVariableNode | ||
attributes: | ||
flags = 0 | ||
frameSlot = 0 # (self) | ||
children: | ||
valueNode = | ||
ProfileArgumentNodeGen | ||
attributes: | ||
flags = 0 | ||
children: | ||
childNode_ = | ||
ReadSelfNode | ||
attributes: | ||
flags = 0 | ||
RubyCallNode | ||
attributes: | ||
descriptor = NoKeywordArgumentsDescriptor | ||
dispatchConfig = PRIVATE | ||
emptyKeywordsProfile = false | ||
flags = 1 | ||
isAttrAssign = false | ||
isSafeNavigation = false | ||
isSplatted = false | ||
isVCall = true | ||
lastArgIsNotHashProfile = false | ||
methodName = "a" | ||
notEmptyKeywordsProfile = false | ||
notRuby2KeywordsHashProfile = false | ||
children: | ||
receiver = | ||
SelfNode | ||
attributes: | ||
flags = 0 | ||
RubyCallNode | ||
attributes: | ||
descriptor = NoKeywordArgumentsDescriptor | ||
dispatchConfig = PRIVATE | ||
emptyKeywordsProfile = false | ||
flags = 1 | ||
isAttrAssign = false | ||
isSafeNavigation = false | ||
isSplatted = false | ||
isVCall = true | ||
lastArgIsNotHashProfile = false | ||
methodName = "b" | ||
notEmptyKeywordsProfile = false | ||
notRuby2KeywordsHashProfile = false | ||
children: | ||
receiver = | ||
SelfNode | ||
attributes: | ||
flags = 0 | ||
RubyCallNode | ||
attributes: | ||
descriptor = NoKeywordArgumentsDescriptor | ||
dispatchConfig = PRIVATE | ||
emptyKeywordsProfile = false | ||
flags = 1 | ||
isAttrAssign = false | ||
isSafeNavigation = false | ||
isSplatted = false | ||
isVCall = true | ||
lastArgIsNotHashProfile = false | ||
methodName = "c" | ||
notEmptyKeywordsProfile = false | ||
notRuby2KeywordsHashProfile = false | ||
children: | ||
receiver = | ||
SelfNode | ||
attributes: | ||
flags = 0 | ||
NilLiteralNode | ||
attributes: | ||
flags = 0 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.