зеркало из https://github.com/github/ruby.git
[ruby/prism] Set contains_keywords flag for implicit gets($/, chomp: true) method call to handle -l CLI option
https://github.com/ruby/prism/commit/717e41c87d
This commit is contained in:
Родитель
b8c8529dcf
Коммит
8d359644e7
|
@ -21906,6 +21906,7 @@ wrap_statements(pm_parser_t *parser, pm_statements_node_t *statements) {
|
||||||
));
|
));
|
||||||
|
|
||||||
pm_arguments_node_arguments_append(arguments, (pm_node_t *) keywords);
|
pm_arguments_node_arguments_append(arguments, (pm_node_t *) keywords);
|
||||||
|
pm_node_flag_set((pm_node_t *) arguments, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_statements_node_t *wrapped_statements = pm_statements_node_create(parser);
|
pm_statements_node_t *wrapped_statements = pm_statements_node_create(parser);
|
||||||
|
|
|
@ -52,6 +52,9 @@ module Prism
|
||||||
assert_kind_of CallNode, predicate
|
assert_kind_of CallNode, predicate
|
||||||
assert_equal :gets, predicate.name
|
assert_equal :gets, predicate.name
|
||||||
|
|
||||||
|
arguments = predicate.arguments
|
||||||
|
assert arguments.contains_keywords?
|
||||||
|
|
||||||
arguments = predicate.arguments.arguments
|
arguments = predicate.arguments.arguments
|
||||||
assert_equal 2, arguments.length
|
assert_equal 2, arguments.length
|
||||||
assert_equal :$/, arguments.first.name
|
assert_equal :$/, arguments.first.name
|
||||||
|
|
Загрузка…
Ссылка в новой задаче