-
Notifications
You must be signed in to change notification settings - Fork 189
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
feat: add fmtstr::quoted
#6018
feat: add fmtstr::quoted
#6018
Conversation
Changes to Brillig bytecode sizes
There are no changes in circuit sizes |
🚀 Deployed on https://66e319bd7e5e443a56f5ad9e--noir-docs.netlify.app |
FYI @noir-lang/developerrelations on Noir doc changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoting & unquoting a format string will already turn it into a regular string so I don't think we need this method.
We could possibly instead add a helper method:
fn as_quoted_str(self) -> Quoted {
let s = std::meta::unquote!(quote { $self });
quote { $s }
}
Would that be a method of |
I'll split the "Correctly print string tokens" commit into a separate PR in the meantime... |
Description
Problem
Reviving the first commit in #5942
Summary
This adds a way to turn a
fmtstr
into aQuoted
value that holds a string token. Otherwise there's no way to create string tokens by interpolating dymamic (well, at compile-time) values.This PR also fixes an issue with how string tokens are displayed. Previously they wouldn't include the double quotes, and special characters weren't escaped.
Additional Context
Documentation
Check one:
PR Checklist
cargo fmt
on default settings.