Skip to content

[GR-45043] Integrate YARP parser [Part 8] #3406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 131 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
346509b
Add YAML fixture for forwarding-all-arguments argument
andrykonchin Dec 26, 2023
d883c08
Translate ForwardingArgumentsNode
andrykonchin Dec 26, 2023
1bbb35d
Fix translation of Array with splat operator inside
andrykonchin Dec 27, 2023
0be8cdf
Fix translation of rescue operator and assigning local variable an ex…
andrykonchin Dec 27, 2023
371c6dd
Translate Hash literal with omitted value
andrykonchin Dec 27, 2023
32ec6a0
Fix translation of BEGIN node and translate it (and declare local var…
andrykonchin Dec 27, 2023
256a54b
Translate & parameter and its forwarding
andrykonchin Dec 27, 2023
2aecda9
Fix translation of for-loop with empty body
andrykonchin Dec 28, 2023
0ae851d
Fix source location for manually created Prism nodes
andrykonchin Dec 28, 2023
9e23fbb
Add YAML fixtures for embedded in String, Symbol and Regexp variables
andrykonchin Dec 28, 2023
398787e
Translate EmbeddedVariableNode
andrykonchin Dec 28, 2023
6ec9afe
Add YAML fixture for implicit rest in nested multi-assignment
andrykonchin Dec 28, 2023
16b783f
Translate ImplicitRest node in nested multi-assignment
andrykonchin Dec 28, 2023
e1a81e2
Fix translation of ||= and undefined fully qualified constant
andrykonchin Dec 29, 2023
044920b
Set proper source encoding
andrykonchin Jan 3, 2024
3e09e87
Fix return in ensure block when begin block is empty
andrykonchin Jan 3, 2024
6404d83
Mark module_eval as using truffleruby_primitives
eregon Jan 4, 2024
8fe67b3
Fix translation of PostExecutionNode
eregon Jan 4, 2024
2db3f8d
Use ByteBasedCharSequence whenever possible
eregon Jan 4, 2024
09705c3
Change END_spec.rb test to rely on exception class name instead of ex…
andrykonchin Jan 4, 2024
e5e525b
Fix SourceSection given to syntaxErrorAlreadyWithFileLine()
eregon Jan 9, 2024
760a3da
Fix Regexp encoding when encoding option is specified explicitly
andrykonchin Jan 9, 2024
199f7cd
Add main_script attribute in YAML fixtures
andrykonchin Jan 9, 2024
723cf68
Add YAML fixture for TOPLEVEL_BINDING constant
andrykonchin Jan 9, 2024
3740ac4
Translate __END__ keyword and define DATA constant
andrykonchin Jan 10, 2024
cbec2a7
Pass local variable names to eval
andrykonchin Jan 8, 2024
21d3a23
Use file path provided by Prism to translate __FILE__ keyword
andrykonchin Jan 11, 2024
5bb0d1b
Raise SyntaxError in runtime for invalid yield
andrykonchin Jan 11, 2024
5b63fd7
Tag failed specs related to known Prism issues
andrykonchin Jan 11, 2024
5fb8b16
Add failing specs for defined?
andrykonchin Jan 3, 2024
e1fc4de
Fix defined? and return "assignment" for some cases of assignment ope…
andrykonchin Jan 12, 2024
a96fd1e
Fix translation of flip-flop operator within Kernel#eval
andrykonchin Dec 28, 2023
47bb555
Fix parsing Integer literals with multiple "_" characters
andrykonchin Jan 16, 2024
7e9a984
Fix Rational Float literals with 0 in integral part
andrykonchin Jan 16, 2024
b861b5c
Fix encoding of concatenated String literals
andrykonchin Jan 16, 2024
4aa808f
Set source location for module/class constants
andrykonchin Jan 16, 2024
527bdc6
Tag failed spec in spec/ruby/core/warning/warn_spec.rb
andrykonchin Jan 16, 2024
7f768ed
Add failing specs for block parameters
andrykonchin Jan 16, 2024
9163c41
Fix block post parameters
andrykonchin Jan 16, 2024
e3dd159
Add specs for block pre and post parameters at destructuring a single…
andrykonchin Jan 16, 2024
ce78bc9
Fix block parameters when a single array argument is being destructured
andrykonchin Jan 17, 2024
34c54bd
Mark coverage lines in YARPTranslator
eregon Jan 17, 2024
c48b547
Make Parser.java Java 8 compatible (required for JRuby)
eregon Jan 17, 2024
95c6b61
Import ruby/prism@606810cc8af118f92f270b09e3ffe94086eb8c12
eregon Jan 17, 2024
35c006b
Adopt latest Prism changes
eregon Jan 17, 2024
0a3f213
Refactor ParsingOptions class
andrykonchin Jan 17, 2024
10306d0
Add specs for forwarding multiple _ parameters to super
andrykonchin Jan 4, 2024
dbe1270
Fix forwarding multiple _ to super
eregon Jan 17, 2024
27db973
Use TranslatorEnvironment#findFrameSlot instead of TranslatorEnvironm…
andrykonchin Jan 18, 2024
ac1d65f
Don't rely in specs on SyntaxError message - only on class name
andrykonchin Jan 18, 2024
e5a8589
Fix rescue with local variable capturing outside a method or block
andrykonchin Jan 18, 2024
f18caf4
Fix BEGIN blocks when -n command line option is passed
andrykonchin Jan 19, 2024
72b0f52
Fix parsing empty Ruby source file
andrykonchin Jan 19, 2024
9a07af3
Import ruby/prism@f1fa486bdd8297e84495c6a6bcc064d127c0d628
andrykonchin Jan 19, 2024
7c54367
Use Ruby 3.3.0 syntax for Prism parser
andrykonchin Jan 19, 2024
3e7497f
Fix triggering :class TracePoint events
andrykonchin Jan 22, 2024
12aa60f
Temporary tag all the pattern matching specs as failed
andrykonchin Jan 22, 2024
728da83
Switch the default of the --prism option to true
andrykonchin Jan 22, 2024
2bc8736
Do not autosplat a proc that accepts a single positional argument and…
andrykonchin Jan 22, 2024
e59e3a3
Support passing anonymous * and ** parameters as method call arguments
andrykonchin Jan 22, 2024
5d55cf1
Find libyarpbindings.so for the bootstrap launcher
eregon Jan 23, 2024
0fbd659
Fix RubyDebugTest
eregon Jan 23, 2024
67278b9
The Ruby home needs to always exist to find libyarpbindings
eregon Jan 23, 2024
f2f29c7
Add missing guard for Array#* for the case of `[] * negative`
eregon Jan 23, 2024
42dd407
Deduplicate code
eregon Jan 23, 2024
a41a7fa
Make all Prism warnings $VERBOSE=true warnings
eregon Jan 23, 2024
a60d4ca
Add TRUFFLERUBY-RESOURCES to classpath for TCK tests
eregon Jan 23, 2024
d156c1c
Fix instrumentation of WriteLocalVariableNode under AssignRescueVaria…
eregon Jan 23, 2024
3cebf71
Add an option to instrument all isInstrumentable() nodes regardless o…
eregon Jan 24, 2024
de0f8e8
Use RubyContextSourceAssignableNode for more nodes and add CheckStyle…
eregon Jan 24, 2024
4777201
Fix remaining instrumentation issues revealed by --instrument-all-nodes
eregon Jan 24, 2024
73541f4
Add spec for `defined?(a[0] = 1)`
eregon Jan 24, 2024
521c609
Add CI check for `jt test fast -- --instrument-all-nodes`
eregon Jan 24, 2024
ac8a083
Tag failing spec due to Prism warning issue
eregon Jan 24, 2024
33917e8
Avoid Encoding#getCharset() as much as possible since it does not alw…
eregon Jan 25, 2024
0479923
Use our own bytes to java.lang.String conversion for Prism Loader
eregon Jan 25, 2024
f06c59e
Add tool to conveniently show the Truffle AST
eregon Jan 25, 2024
17a5fb4
Reformat coverage test for convenience
eregon Jan 25, 2024
30b1348
doExecuteVoid() must not be delegated by RubyNodeWrapper
eregon Jan 25, 2024
a3b90a8
Correctly instrument executeVoid()
eregon Jan 25, 2024
06e4beb
Use ZERO_PARAMETERS_NODE consistently
eregon Jan 26, 2024
f86bb5a
Exclude failed MRI test test_float
andrykonchin Jan 25, 2024
80f8e89
Fix multi assignment with index referencing and splat
andrykonchin Jan 25, 2024
9e2104b
Simplify
eregon Jan 26, 2024
7ae0112
Clarify
eregon Jan 26, 2024
9b6f02f
Ignore node wrappers in RubyCallNode#getLastArgumentNode()
eregon Jan 27, 2024
298dbac
Allow Prism syntax error message for duplicated parameters in test_sy…
eregon Jan 27, 2024
e927a98
Exclude failing test_syntax.rb due to different messages in Prism
eregon Jan 27, 2024
e199349
Exclude corner case heredoc test failing on Prism
eregon Jan 27, 2024
7aa76ac
Exclude failing test_syntax.rb due to different messages in Prism
eregon Jan 27, 2024
d150a48
Raise a proper SyntaxError for pattern matching until implemented
eregon Jan 27, 2024
681fcca
Import ruby/prism@d69b9da805d525c13a8d4386aea6bc0da8e6cf63
eregon Jan 27, 2024
65fdeba
Adopt WarningLevel from Prism
eregon Jan 27, 2024
a6f5a6f
Introduce YARPBaseTranslator
eregon Jan 27, 2024
7ff628f
Add YARPPatternMatchingTranslator based on PatternMatchingTranslator
eregon Jan 27, 2024
11d5b57
Implement Hash pattern matching and the rest of pattern matching
eregon Jan 27, 2024
f3cad5f
Raise a SyntaxError if the translator does not know how to deal with …
eregon Jan 28, 2024
4ca8e3f
Enable pattern matching by default and remove the option
eregon Jan 28, 2024
bfc4cdd
Untag MRI pattern matching tests
eregon Jan 28, 2024
38a9dfa
Add ChangeLog entry
eregon Jan 28, 2024
c8668bf
Add specs for `value in pattern` pattern matching
eregon Jan 28, 2024
3068280
Implement `value in pattern` pattern matching
eregon Jan 28, 2024
74e2b6b
Run MRI tests in a deterministic order
eregon Jan 28, 2024
f4f24b4
Spec that Constant === object is checked before calling #deconstruct/…
eregon Jan 28, 2024
3406d1d
Fix checking pattern constant on the object and not on the deconstruc…
eregon Jan 28, 2024
5eab6ba
Add pattern matching specs for `in {}` and `in {**nil}`
eregon Jan 28, 2024
7b70fa8
Fix `in {}` pattern matching
eregon Jan 28, 2024
9af3956
No need to subtract keys if no keys for pattern matching
eregon Jan 28, 2024
07aa2ae
Make TestPatternMatching#test_hash_pattern and more pass with Prism
eregon Jan 28, 2024
1866c85
Save the ParserContext in ParseEnvironment for convenience
eregon Jan 28, 2024
fc1aa20
Avoid storing the source path in RubySource because that is problemat…
eregon Jan 28, 2024
c5cae5e
Move fields to ParseEnvironment to pass less arguments to translators
eregon Jan 28, 2024
fd1813a
Add missing --experimental-options
eregon Jan 29, 2024
53953de
Exclude MRI tests failing due to missing regexp encoding flags in Prism
eregon Jan 29, 2024
a6dc1e0
Adapt MRI tests to allow Prism error messages
eregon Jan 29, 2024
6769f95
Workaround https://github.com/ruby/prism/issues/2289
eregon Jan 29, 2024
cd64acb
Make a helper method ArrayUtils.getLast generic and use it for transl…
andrykonchin Jan 29, 2024
d6465e9
Add enum for Prism syntax versions
andrykonchin Jan 29, 2024
98798eb
Use CompilerDirectives.shouldNotReachHere instead of IllegalStateExce…
andrykonchin Jan 29, 2024
56a3aea
Remove redundant check in handling rescue operator
andrykonchin Jan 29, 2024
12cd32b
Use OrLazyValueDefinedNode instead of OrNode for fully qualified cons…
andrykonchin Jan 29, 2024
bf4a4d0
Remove leading empty string literal node in InterpolatedRegexpNode th…
andrykonchin Jan 29, 2024
5e3b726
Make ParseEnvironment#yarpSource final
eregon Jan 29, 2024
50843a3
Use Prism Nodes.Source#computeLineOffsets()
eregon Jan 29, 2024
d6dec92
Exclude transient MRI test
eregon Jan 29, 2024
c4191e1
Correct FFI version in legal.md and 3rd_party_licenses.txt
eregon Jan 29, 2024
08532d9
Add Prism to legal.md
eregon Jan 29, 2024
e31efe7
Extract code to find the correct encoding for a literal regexp and us…
eregon Jan 30, 2024
c87fe8f
Import ruby/prism@0cc6110ef714c03886ce3e712ac3a463ccd4a174
eregon Jan 30, 2024
2f16599
Revert "Workaround https://github.com/ruby/prism/issues/2289"
eregon Jan 30, 2024
9b405d7
Update to latest Prism syntax error messages
eregon Jan 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add YAML fixture for forwarding-all-arguments argument
  • Loading branch information
andrykonchin authored and eregon committed Jan 28, 2024
commit 346509b1d73003d45e34ff8c936e7f7e6cc47996
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
subject: "Def"
description: "parameter forwarding / forward arguments (...)"
focused_on_node: "org.truffleruby.language.methods.LiteralMethodDefinitionNode"
ruby: |
def foo(...)
bar(...)
end
ast: |
LiteralMethodDefinitionNode
attributes:
callTargetSupplier = org.truffleruby.language.methods.CachedLazyCallTargetSupplier@...
flags = 1
isDefSingleton = false
name = "foo"
sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = true, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = true}, originName = foo, blockDepth = 0, parseName = Object#foo, notes = null, argumentDescriptors = [ArgumentDescriptor(name = %forward_rest, type = rest), ArgumentDescriptor(name = %forward_kwrest, type = keyrest), ArgumentDescriptor(name = %forward_block, type = block)])
call targets:
RubyMethodRootNode
attributes:
arityForCheck = Arity{preRequired = 0, optional = 0, hasRest = true, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = true}
callTarget = Object#foo
checkArityProfile = false
frameDescriptor = FrameDescriptor@...{#0:(self), #1:%$~_, #2:%forward_rest, #3:%forward_kwrest, #4:%forward_block, #5:%method_block_arg}
instrumentationBits = 0
keywordArguments = true
localReturnProfile = false
lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked]
matchingReturnProfile = 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 = true, isImplicitRest = false, postRequired = 0, keywordArguments = [], requiredKeywordArgumentsCount = 0, hasKeywordsRest = true}, originName = foo, blockDepth = 0, parseName = Object#foo, notes = null, argumentDescriptors = [ArgumentDescriptor(name = %forward_rest, type = rest), ArgumentDescriptor(name = %forward_kwrest, type = keyrest), ArgumentDescriptor(name = %forward_block, type = block)])
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
SaveMethodBlockNode
attributes:
flags = 0
slot = 5
WriteLocalVariableNode
attributes:
flags = 0
frameSlot = 2 # %forward_rest
children:
valueNode =
ReadRestArgumentNode
attributes:
flags = 0
keywordArguments = true
markKeywordHashWithFlag = false
postArgumentsCount = 0
startIndex = 0
WriteLocalVariableNode
attributes:
flags = 0
frameSlot = 3 # %forward_kwrest
children:
valueNode =
ReadKeywordRestArgumentNode
attributes:
excludedKeywords = []
flags = 0
children:
hashes =
HashStoreLibraryGen$CachedDispatchFirst
attributes:
limit_ = 3
readUserKeywordsHashNode =
ReadUserKeywordsHashNode
SaveMethodBlockNode
attributes:
flags = 0
slot = 4
RubyCallNode
attributes:
descriptor = KeywordArgumentsDescriptor(keywords = [])
dispatchConfig = PRIVATE
emptyKeywordsProfile = false
flags = 1
isAttrAssign = false
isSafeNavigation = false
isSplatted = true
isVCall = false
lastArgIsNotHashProfile = false
methodName = "bar"
notEmptyKeywordsProfile = false
notRuby2KeywordsHashProfile = false
children:
arguments = [
ArrayAppendOneNodeGen
attributes:
flags = 0
children:
arrayNode_ =
KernelNodesFactory$DupASTNodeFactory$DupASTNodeGen
attributes:
flags = 0
children:
selfNode_ =
SplatCastNodeGen
attributes:
conversionMethod = :to_a
copy = true
flags = 0
nilBehavior = CONVERT
children:
childNode_ =
ReadLocalVariableNode
attributes:
flags = 0
frameSlot = 2 # %forward_rest
type = FRAME_LOCAL
valueNode_ =
HashCastNodeGen$HashCastASTNodeGen
attributes:
flags = 0
children:
childNode_ =
ReadLocalVariableNode
attributes:
flags = 0
frameSlot = 3 # %forward_kwrest
type = FRAME_LOCAL
]
block =
ToProcNodeGen
attributes:
flags = 0
children:
childNode_ =
ReadLocalVariableNode
attributes:
flags = 0
frameSlot = 4 # %forward_block
type = FRAME_LOCAL
receiver =
SelfNode
attributes:
flags = 0
]