PSyclone
PSyclone copied to clipboard
Specify language writer to use in error messages in configuration?
There are a number of places where we use a writer when constructing error messages. At the moment the writer to use normally defaults to FortranWriter
but can b overridden by the caller of a particular routine. This is a bit ad hoc and doesn't expose the control of the writer at a useful level.
I propose that we make the choice of writer to use for error messages a configuration option (i.e. part of the Config class). What do people think?
Sure, but I would think that's extremely low priority? Afaik our support for non-Fortran is pretty minimal. But otherwise I agree, specifying a default language in the config file would be the way to go.
Since I am introducing the node.debug_string()
for error messages which takes care of avoiding the deep_copy issue and replacing the FortranWriter in error messages with this new functionality I think it does not make sense to have it configurable anymore and we can close this issue.
While I still consider this extremely low priority (i.e. at this stage I would consider implementing this a waste of time with so much on our todo list ;) ), it would appear to me that it would be reasonable simple to just pick the writer to use based on a config file setting (though ... I would actually argue that it might be worth storing the original language, so we could issue error messages in the language that the input was in). Having said all of that, it's so low priority, I am happy to close it, and once we should have a use case we can look at it.
Ok, so no need to close the issue. At least now there is a single point where this configuration decision can take place (inside the debug_string() method), before the Writers were distributed in multiple places, some hardcoded. Which would just change some error messages but not all.