udoprog / genco

A whitespace-aware quasiquoter for beautiful code generation.
Apache License 2.0
181 stars 11 forks source link

genco tokenization of rust lifetimes broken in 0.16 #21

Closed dvc94ch closed 2 years ago

dvc94ch commented 2 years ago

So it's nice that it builds on stable, but it doesn't quite work with lifetimes. ' static is not valid rust, rustc complains that a "character literal may only contain one codepoint".

udoprog commented 2 years ago

There might not be enough info to resolve this. Apparently the ' punctuation might not have joined spacing. But I'll look into it to see if there's anything that can be done.

Cheers!

udoprog commented 2 years ago

Should be fixed now in 0.16.1!

dvc94ch commented 2 years ago

Gave it a try. The fix fixes the life time issue but found another one. Identifiers are split in weird ways: tmp0 _0 should be tmp0_0.

udoprog commented 2 years ago

Yeah. I don't think there's much to be done there unfortunately. We can't tell when there is some space between two things and no space.

To construct an identifier that is concatenated we'd have to resort to some form of markup or formatting the identifier inline, like: #(format!("{}{}", "tmp0", "_0")).