-
Notifications
You must be signed in to change notification settings - Fork 3
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
Quote Macro #93
base: master
Are you sure you want to change the base?
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.