[PRISM] Fix lambda start column number
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
This commit is contained in:
parent
b662edf0a0
commit
d357d50f0a
@ -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->parameters = cast->parameters;
|
||||||
scope->body = cast->body;
|
scope->body = cast->body;
|
||||||
scope->locals = cast->locals;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case PM_MODULE_NODE: {
|
case PM_MODULE_NODE: {
|
||||||
|
@ -1838,6 +1838,15 @@ end
|
|||||||
assert_prism_eval("-> { to_s }.call")
|
assert_prism_eval("-> { to_s }.call")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_LambdaNode_with_multiline_args
|
||||||
|
assert_prism_eval(<<-CODE)
|
||||||
|
-> (a,
|
||||||
|
b) {
|
||||||
|
a + b
|
||||||
|
}.call(1, 2)
|
||||||
|
CODE
|
||||||
|
end
|
||||||
|
|
||||||
def test_ModuleNode
|
def test_ModuleNode
|
||||||
assert_prism_eval("module M; end")
|
assert_prism_eval("module M; end")
|
||||||
assert_prism_eval("module M::N; end")
|
assert_prism_eval("module M::N; end")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user