Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
24fafec
Add a very bad no good prinfln macro
expenses Oct 16, 2021
5656770
Use a better registry identifier
expenses Oct 16, 2021
9931531
Do a little bit of argument count checking
expenses Oct 16, 2021
4f2048d
Use OpLoads to be able to print vectors
expenses Oct 16, 2021
6a21a29
Add an error for string literal expressions
expenses Oct 16, 2021
2ee529e
Revert "Add an error for string literal expressions"
expenses Oct 16, 2021
9311710
Add both printf and printfln, allow for other kinds of expressions by…
expenses Oct 16, 2021
a6c29fe
Tidy up a little
expenses Oct 16, 2021
29481ba
Add a compiletest
expenses Oct 17, 2021
1f68124
Run rustfmt
expenses Oct 17, 2021
d095849
Rename to debug_printf
expenses Oct 18, 2021
2f4f9c9
Parse variables using punctated
expenses Oct 18, 2021
aecdf5b
Handle inner quotes
expenses Oct 18, 2021
564165f
Add tests for function and method calls
expenses Oct 18, 2021
fb6f66c
Escape only quote marks
expenses Oct 18, 2021
0f0d13d
Run rustfmt
expenses Oct 18, 2021
b545f6b
Use a regex to parse types from the format string and assert them wit…
expenses Oct 19, 2021
42978ab
Add extra tests, escape the string correctly while keeping printfln n…
expenses Oct 20, 2021
a0f4615
Use the string debug impl after all
expenses Oct 20, 2021
b4c0d28
Merge remote-tracking branch 'origin/main' into printfln-macro
expenses Oct 20, 2021
c59e3ce
Cargo fmt
expenses Oct 21, 2021
53ae4a1
Merge branch 'printf-macro-type-checking' into printfln-macro
expenses Oct 21, 2021
ffc7505
Cargo fmt again
expenses Oct 21, 2021
81d4103
fmt compiletest
expenses Oct 21, 2021
81ad59e
Merge match branches
expenses Oct 21, 2021
602b691
Improved argument checking
expenses Oct 21, 2021
8c76f59
Filter out captures like %%f
expenses Oct 21, 2021
6fbde8e
Use a peekable character iterator to parse the format string into rus…
expenses Oct 21, 2021
2836b3e
continue on %% to unindent the code
expenses Oct 21, 2021
7155e3b
Finishing touches
expenses Oct 22, 2021
aa6345f
Rustfmt
expenses Oct 22, 2021
41ea76e
Re-bless compile tests
expenses Oct 22, 2021
10575d3
Only last tiny change: Replace impl Iterator with std::str::Chars
expenses Oct 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle inner quotes
  • Loading branch information
expenses committed Oct 18, 2021
commit aecdf5bc6c3d7768b788842adc6ed9ff1aae2bcb
2 changes: 1 addition & 1 deletion crates/spirv-std/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
.collect::<proc_macro2::TokenStream>();
let op_loads = op_loads.into_iter().collect::<proc_macro2::TokenStream>();

let op_string = format!("%string = OpString \"{}\"", format_string);
let op_string = format!("%string = OpString {:?}", format_string);

let output = quote::quote! {
asm!(
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/arch/debug_printf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub fn main() {
debug_printf!();
debug_printfln!();
debug_printfln!("Hello World");
debug_printfln!("Hello World",);
debug_printfln!(r#"Hello "World""#);
}

let vec = Vec2::new(1.52, 25.1);
Expand Down