github / semantic

Parsing, analyzing, and comparing source code across many languages
8.94k stars 453 forks source link

Distinguish between statements and expressions #669

Open robrix opened 2 years ago

robrix commented 2 years ago

This doesn't apply to all languages, but it would be nice to distinguish between statements and expressions at the level of abstract domains.

The goal would be to avoid polluting the abstract domain with stuff that doesn't actually relate to it, e.g. imports.

robrix commented 2 years ago

One possibility is simply to model them with instrumentation: an out-of-band effect notified of various events (e.g. an import was reached), with unit returned by each.