That's really helpful and insightful. I had specifically avoided mentioning dataflow analysis, I still think a lot of progress could be made with that approach. Essentially modify the interpreter to run every branch, both the true and false clauses of if, and note what strings have what value at that point of execution.
in your final example, you can replace the map with a big case switch of all known functions and an error clause.
That's of course, a lot of work. I'd guess it's just not worth it.
in your final example, you can replace the map with a big case switch of all known functions and an error clause.
That's of course, a lot of work. I'd guess it's just not worth it.