Skip to main content

Module value_shape_inferrer

Module value_shape_inferrer 

Source
Expand description

Semantic analysis, symbol extraction, and type inference. Lightweight value-shape inference from constructor calls, bless, and $self. Lightweight value-shape inference from Perl AST patterns.

Walks the AST to infer [ValueShape] approximations for variables based on common Perl idioms:

Perl patternInferred shape
Foo->new(...)Object { "Foo", Medium }
bless $ref, 'Pkg'Object { "Pkg", Low }
$self in method bodyObject { <enclosing package>, Medium }
sub method($self, ...)Object { <enclosing package>, High }
my ($self) = @_Object { <enclosing package>, Medium }
DBI->connect(...)Object { "DBI::db", Medium }
$dbh->prepare(...) after DBI connectObject { "DBI::st", Medium }
unknownUnknown

The inferrer does not perform full type inference — it recognises syntactic patterns and assigns conservative shapes.

Structs§

ValueShapeInferrer
Inferrer that walks an AST to produce (EntityId, ValueShape) pairs.