-
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
Extra blanks in generated cpp_closures.cpp #96
Comments
After careful observation it becomes clear that whitespaces were actually a macro invocation code and rust syntax tokens. They got replaced instead of being removed to keep inner macro tokens at the same relative line:column locations as in original code. So even though this &*cpp!([]-> *const QObjectDescriptor as "RustQObjectDescriptor const*" {
return RustQObjectDescriptor::instance<RustObject<QObject>>();
}) becomes this
that's only to keep things in place which could possibly come after |
But the extra whitespace is not really a problem, is it? |
No, not really a technical issue AFAICT. It's just my stupid perfectionism. Cuts my eye, so to say. Probably not worth fixing something that just works.
|
What's important is that the error message the the compiler still points to the right location. the error location could be perfected. For example, the return type and the argument type are not in lines that are marked with #line so if there is a typo in these, it leads to difficult errors. |
In the generated cpp_closures.cpp, every chunk of code copied verbatim from
cpp!([]{})
content is preceded by#line
pragma and a line with an inconsistently large amount of spaces. Which probably indicated there is some minor bug in parser.For example, these fragments of Rust:
produce this C++ output:
Macro code responsible for this is probably somewhere around here:
rust-cpp/cpp_build/src/lib.rs
Lines 43 to 52 in b826bc5
The text was updated successfully, but these errors were encountered: