4 ms·
not sure there's a simple codebase to study for learning this stuff, but most sophisticated linters or static analyzers will have some amount of dataflow. At m
by awinter-py 8y ago
not sure there's a simple codebase to study for learning this stuff, but most sophisticated linters or static analyzers will have some amount of dataflow.
At minimum you're going to be managing nested scopes, resolving names to values and assigning types to names.
Sample PR from the eslint project that has all these elements:
https://github.com/eslint/eslint/pull/10020/files https://github.com/eslint/eslint/pull/10020/files
IMO dataflow is more useful for dynamically typed languages. In static languages where the type of every name is declared somewhere, tracing values through local scopes and function calls isn't as critical (though still valuable).