[PRISM] Fix lambda start column number

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
This commit is contained in:
Nikita Vasilevsky 2024-02-07 16:51:22 +00:00 коммит произвёл Kevin Newton
Родитель b662edf0a0
Коммит d357d50f0a
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -2510,6 +2510,13 @@ pm_scope_node_init(const pm_node_t *node, pm_scope_node_t *scope, pm_scope_node_
scope->parameters = cast->parameters;
scope->body = cast->body;
scope->locals = cast->locals;
if (cast->parameters != NULL) {
scope->base.location.start = cast->parameters->location.start;
}
else {
scope->base.location.start = cast->operator_loc.end;
}
break;
}
case PM_MODULE_NODE: {

Просмотреть файл

@ -1838,6 +1838,15 @@ end
assert_prism_eval("-> { to_s }.call")
end
def test_LambdaNode_with_multiline_args
assert_prism_eval(<<-CODE)
-> (a,
b) {
a + b
}.call(1, 2)
CODE
end
def test_ModuleNode
assert_prism_eval("module M; end")
assert_prism_eval("module M::N; end")