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 pattern | Inferred shape |
|---|---|
Foo->new(...) | Object { "Foo", Medium } |
bless $ref, 'Pkg' | Object { "Pkg", Low } |
$self in method body | Object { <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 connect | Object { "DBI::st", Medium } |
| unknown | Unknown |
The inferrer does not perform full type inference — it recognises syntactic patterns and assigns conservative shapes.
Structs§
- Value
Shape Inferrer - Inferrer that walks an AST to produce
(EntityId, ValueShape)pairs.