зеркало из https://github.com/github/ruby.git
[PRISM] Implement NoKeywordsParameterNode
This commit is contained in:
Родитель
4f1adb0107
Коммит
fe0827013b
|
@ -2193,6 +2193,8 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
case PM_NIL_NODE:
|
||||
PM_PUTNIL_UNLESS_POPPED
|
||||
return;
|
||||
case PM_NO_KEYWORDS_PARAMETER_NODE:
|
||||
return;
|
||||
case PM_NUMBERED_REFERENCE_READ_NODE: {
|
||||
if (!popped) {
|
||||
uint32_t reference_number = ((pm_numbered_reference_read_node_t *)node)->number;
|
||||
|
|
|
@ -619,6 +619,11 @@ module Prism
|
|||
test_prism_eval("[1].map { |a; b| b = 2; a + b}")
|
||||
end
|
||||
|
||||
def test_NoKeywordsParameterNode
|
||||
test_prism_eval("def prism_test_no_keywords(**nil); end")
|
||||
test_prism_eval("def prism_test_no_keywords(a, b = 2, **nil); end")
|
||||
end
|
||||
|
||||
def test_OptionalParameterNode
|
||||
test_prism_eval("def prism_test_optional_param_node(bar = nil); end")
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче