Quote Macro#93
Conversation
ab2e5f8 to
9a2964c
Compare
|
Btw you can also mark these as draft if they are not ready yet. CI should still run afaik |
05d6462 to
f903e10
Compare
|
Hmm this is hard to review. We used to have reference files for the queries that show the impact of changes like that. But we do not have those for the new compiler, right now. Without those, it is hard to tell how the quote macro changes the syntax of the generated filters. @jessberg which filters currently compile? |
Currently get_service_name.cql and height.cql should work. You can compile them using: target/debug/dtc -q example_queries/get_service_name.cql -o rust_filter/filter.rs -c sim -r productpage-v1 and target/debug/dtc -q example_queries/height.cql -u example_udfs/height.rs -o rust_filter/filter.rs -c sim -r productpage-v1 |
|
Okay, I will open a separate pull request with tests and reference files for those. After we can rebase this pull request and check the difference. |
|
Okay, you can update this pull request now. It is possible that the tests will fail because of a mismatch in reference files. We will have to update these. |
I noticed we're using string interpolation a lot for code generation. There's a really handy quote macro crate that lets you turn code into a syntax object of sorts. I'm trying out converting the strings to quote macro. Let me know what you think!
Eventually we could look into using proc macros instead of handlebars.