-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support pretty-printing without inlining #include-d code #1042
Comments
I think the issue is a little subtle. Consider two files:
// defined in test1.stanfunctions
void foo(){
return;
}
#include "test1.stanfunctions"
// defined in test2.stanfunctions
void bar(){
foo();
} Now, So, // defined in test1.stanfunctions
void foo() {
return;
}
// defined in test2.stanfunctions
void bar() {
foo();
} So I think the real issue here is "support pretty-printing without inlining |
#include
-d code
#include
-d code
Yes, this would work |
I agree that by default auto-format should not inline The use case is caching models without having to inline includes with some string processing. |
I've been thinking about how the interface should be for formatting, canonicalizing, etc. I think all of these things should be optional and part of the canonicalize command, with So I think we'd want something like |
When the '.stanfunctions' file has an '#include some.stanfunctions' in a different directory the auto formatter fails. One typically wouldn't include the path because it would be specified in the call to cmdstanr via include_paths = "./path_to_file".
The text was updated successfully, but these errors were encountered: