Skip to main content

Module ruby

Module ruby 

Source
Expand description

Checker implementation for Ruby.

Functions§

is_stabby_lambda_body
Whether node — a Block / DoBlock — is the body of a stabby lambda (->(z) { … } / ->(z) do … end), which parses as a Lambda node that CONTAINS the block. The Lambda wrapper already counts as the closure (#465) and opens the function space (#1257), so classifying the body again would double-count one lambda as two closures, or open a phantom nested Function space. The keyword forms lambda { } / proc { } and iterator blocks ([1].each { |x| x }) parse as a Call carrying the block argument — the parent is not a Lambda — so they still classify exactly once.