proc-macro2
proc-macro2 copied to clipboard
Currently when used to implement a proc_macro, `Delimiter::None` simply doesn't do what it is documented to do. While this is a rustc bug (rust-lang/rust#67062), it is a long standing one,...
From the documentation of [`proc_macro_span`](https://github.com/dtolnay/proc-macro2/blob/fecb02df0e2966c7eb39e020dbf650fa8bafd0c5/build.rs#L15C1-L20C3) I was understanding that if you don't allow unstable features in your nightly build, then the build of the crate should still work: "Enabled when...
Updated for https://github.com/rust-lang/rust/pull/111571 My impression is that this can't be merged as it is a breaking change? But providing the changeset anyway perhaps it could be compatible using the old...
(I couldn't work this out from the docs and had to look at example data.)
Migrates the fallback parser to use [`rustc_lexer`](https://github.com/rust-lang/rust/pull/59706). WIP proof of concept currently. Closes #201, closes #126, impacts #55, #5. Failing tests: - [fail](https://github.com/alexcrichton/proc-macro2/blob/bc5ad2414b4f7bddb95810ccc60a37e7aff8b7e5/tests/test.rs#L154-L164) (parses `' static` as `Literal { lit:...
Enhance documentation with more examples on procedure macros, showing api usage.
Currently fallback spans store a pair of 32-bit low and high character indices. https://github.com/dtolnay/proc-macro2/blob/fecb02df0e2966c7eb39e020dbf650fa8bafd0c5/src/fallback.rs#L491-L496 A span in which `lo > hi` is malformed, so right off the bat, approximately half...
Hi, @dtolnay Thank for you great work. I am trying to use proc_macro2 to parse the css content in the project I am working on. You can find it [here](https://github.com/abishekatp/stylers/tree/stylers_build)....
This crates docs for [`LineColumn`](https://docs.rs/proc-macro2/latest/proc_macro2/struct.LineColumn.html) say that the column is 0-indexed. The docs for [`proc_macro::LineColumn`](https://doc.rust-lang.org/proc_macro/struct.LineColumn.html) say that the column is 1-indexed. As far as I can see, this is a...