diff --git a/Cargo.toml b/Cargo.toml index d1fe852..ff49e57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,14 +18,14 @@ rust-version = "1.60" verbatim = ["syn/parsing"] [dependencies] -proc-macro2 = { version = "1.0.74", default-features = false } -syn = { version = "2.0.46", default-features = false, features = ["full"] } +proc-macro2 = { version = "1.0.80", default-features = false } +syn = { version = "2.0.59", default-features = false, features = ["full"] } [dev-dependencies] indoc = "2" -proc-macro2 = { version = "1.0.74", default-features = false } +proc-macro2 = { version = "1.0.80", default-features = false } quote = { version = "1.0.35", default-features = false } -syn = { version = "2.0.46", default-features = false, features = ["parsing"] } +syn = { version = "2.0.59", default-features = false, features = ["parsing"] } [lib] doc-scrape-examples = false diff --git a/src/lit.rs b/src/lit.rs index 3e6c145..10a86e4 100644 --- a/src/lit.rs +++ b/src/lit.rs @@ -1,6 +1,6 @@ use crate::algorithm::Printer; use proc_macro2::Literal; -use syn::{Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr}; +use syn::{Lit, LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitInt, LitStr}; impl Printer { pub fn lit(&mut self, lit: &Lit) { @@ -8,6 +8,7 @@ impl Printer { #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] Lit::Str(lit) => self.lit_str(lit), Lit::ByteStr(lit) => self.lit_byte_str(lit), + Lit::CStr(lit) => self.lit_c_str(lit), Lit::Byte(lit) => self.lit_byte(lit), Lit::Char(lit) => self.lit_char(lit), Lit::Int(lit) => self.lit_int(lit), @@ -26,6 +27,10 @@ impl Printer { self.word(lit.token().to_string()); } + fn lit_c_str(&mut self, lit: &LitCStr) { + self.word(lit.token().to_string()); + } + fn lit_byte(&mut self, lit: &LitByte) { self.word(lit.token().to_string()); }