-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Is your feature request related to a problem? Please describe.
The problem is that messages are tailored for file-based loading and so do not provide assistance when Ergo code is added programmatically. This problem is exacerbated for code that is automatically generated. Here's an example of what I mean:
++Warning[Ergo]> singleton variable ?R in dynamically inserted rule on line <unknown> in file <unknown>
Describe the solution you'd like
One possibility, it seemed to me, would be to catch whatever warning is being generated here, and add more information (most likely just print the problematic rule). I am assuming that the above comes because code for reading rules from a file is being repurposed for use via pyergo. That's just an assumption, of course. A possible challenge would be if a number of rules are injected together. In that case the following alternative might be better:
Create a temp file from the inserted lines of Ergo code, print its location for the user, and issue warnings with line numbers relative to that file. That might be more difficult.