Commit Graph

861 Commits

Author SHA1 Message Date
Alex Crichton
30a4e9e336 Fix the nightly feature outside of rustc
This commit is a stab at getting the `proc_macro2` crate to function outside the
context of the compiler, **even when the `nightly` feature is enabled**.
Previously when the `nightly` feature was enabled then `proc_macro2` would panic
at runtime because `proc_macro` itself would panic at runtime due to the lack of
the compiler being initialized.

In this commit the `unstable` module in `proc_macro2` no longer unconditionally
uses the `proc_macro` upstream crate but is rather an `enum` over the upstream
crate and the `stable` module. At runtime the appropriate implementation is
dynamically selected depending on which works.

This brings up some uncomfortable issues such as what happens when you try to
psas a "stable span" to a "nightly `Literal`", but I think we can paper over
these issues in time by further canonicalizing everything to nightly/stable if
it comes up.

One caveat this brings up is that `Span::unstable` unconditionally panics when
outside the compiler, but I think that's expected regardless.
2018-04-27 22:25:23 -07:00
David Tolnay
6b46debb8e
Copy documentation of semver exempt to rustdoc 2018-04-25 21:25:02 -07:00
David Tolnay
49302e7a25
Fix typo in readme - stabilized 2018-04-25 21:25:02 -07:00
David Tolnay
2c1dac54aa
Bump to 0.3.7 2018-04-23 19:18:07 -07:00
David Tolnay
48ea504504
Format with rustfmt 0.4.2 2018-04-23 19:17:35 -07:00
Alex Crichton
7b052aeab1
Merge pull request #79 from alexcrichton/debug
Improve Debug representations
2018-04-23 08:21:44 -05:00
Alex Crichton
861af7ddb3
Merge pull request #80 from alexcrichton/spacing
Fix spacing of op followed by comment
2018-04-23 08:21:07 -05:00
David Tolnay
3a592ad539
Fix spacing of op followed by comment 2018-04-22 21:20:24 -07:00
David Tolnay
034205f4c9
Improve Debug representations 2018-04-22 16:45:28 -07:00
David Tolnay
11437353d2
Bump to 0.3.6 2018-04-07 09:46:12 -07:00
Alex Crichton
cc77fb99f2
Merge pull request #75 from alexcrichton/validate
Validate input in Term::new
2018-04-07 11:43:41 -05:00
David Tolnay
489c642d59
Validate input in Term::new 2018-04-07 08:42:10 -07:00
Alex Crichton
6de51290de Bump to 0.3.5 2018-04-05 17:58:34 -07:00
Alex Crichton
e24f734b0a Fix build with semver exempt items 2018-04-05 17:58:11 -07:00
Alex Crichton
2f7460bcd3 Bump to 0.3.4 2018-04-05 17:47:14 -07:00
Alex Crichton
9cd80a6497 Fix build on today's nightly 2018-04-05 17:46:58 -07:00
Alex Crichton
dfd23e414f Bump to 0.3.3 2018-04-04 15:05:23 -07:00
Alex Crichton
6e05dac376
Merge pull request #74 from alexcrichton/lex-doc-comments
Lex doc comments as attributes
2018-04-04 17:04:57 -05:00
Alex Crichton
1eb96a0e54 Lex doc comments as attributes
This means they no longer round trip but it should be more faithful to what
macro_rules! is doing

Closes #73
2018-04-04 14:15:26 -07:00
Alex Crichton
99d9630273 Bump to 0.3.2 2018-04-04 07:59:45 -07:00
Alex Crichton
2faaac738e
Merge pull request #72 from alexcrichton/tweak-interfaces
Tweak implementation details for upcoming changes
2018-04-04 09:59:08 -05:00
Alex Crichton
a914a61074 Tweak how the library's interface is implemented
The stable/unstable modules still implemented the *very first* iteration of the
`proc_macro` API which has long since gone away. This tweaks notably the
`Literal` constructors to match what's proposed today, allowing lossless
conversions of literals on the stable implementation.
2018-04-04 07:52:33 -07:00
Alex Crichton
b2c9462f2a Prepare more for new proc_macro API
* Move storage of `Span` information on `Literal` and `Term` into the
  stable/unstable layers as the unstable one will soon encompass this
* Remove `PartialEq` for `Span` as it's being replaced by an `eq` method.
2018-04-04 07:36:41 -07:00
David Tolnay
b28f38a669
Format with rustfmt 0.4.1 2018-03-31 22:02:29 +02:00
David Tolnay
e3573b9c02
Bump to 0.3.1 2018-03-31 21:28:47 +02:00
David Tolnay
a13d142d0c
Support raw identifiers 2018-03-31 21:27:48 +02:00
David Tolnay
639e4ba7cf
Fix typo in test name 2018-03-31 21:10:55 +02:00
Alex Crichton
2794f105e4 Update version in README 2018-03-31 02:41:31 -07:00
Alex Crichton
b2b4df1cf1
Merge pull request #71 from alexcrichton/v3
Reimplement public interface for stability
2018-03-31 11:36:50 +02:00
Alex Crichton
af5bad4ef2 Reimplement public interface for stability
More information to come later about this, but this is a result of the
work week discussions we've had about stabilizing procedural macros
2018-03-29 12:15:49 -07:00
Alex Crichton
77451ca2c6
Merge pull request #69 from mystor/span-eq
Add PartialEq and Eq implementations for Span
2018-03-12 09:12:20 -05:00
Nika Layzell
9973798bab Add PartialEq and Eq implementations for Span 2018-03-11 18:51:27 -04:00
David Tolnay
1856584c20
Bump to 0.2.3 2018-02-22 10:52:14 -08:00
David Tolnay
5692530bc4
Merge pull request #65 from alexcrichton/proc-macro-feature
Add a feature for linking to `proc-macro`
2018-02-22 10:51:07 -08:00
David Tolnay
724687bc7b
Fix default-features = false, features = ["nightly"] 2018-02-22 10:17:48 -08:00
Alex Crichton
0e8e7f4fed Add a feature for linking to proc-macro
This commit adds a feature to this crate which enables linking to the
upstream `proc_macro` crate. This should help this compile on targets
which don't have `proc_macro` and allow it to also be suitable for
embedding in Rust binaries.

This feature is turned on by default for backwards compatibility right
now.
2018-02-22 06:17:31 -08:00
Alex Crichton
1fd0e8af16 Linkify some documentation
Closes #64
2018-02-04 21:29:13 -08:00
David Tolnay
ce57c9d1a5
Merge pull request #63 from alexcrichton/fix-eof
Allow doc comments to be terminated with EOF
2018-01-25 13:32:43 -08:00
Alex Crichton
d7904e5840 Allow doc comments to be terminated with EOF
Closes #61
2018-01-25 13:27:16 -08:00
David Tolnay
eca28d4276
Bump to 0.2.2 2018-01-21 21:17:28 -08:00
David Tolnay
b9114e6189
Merge pull request #58 from alexcrichton/fix
Add a special case for empty `/*` comments
2018-01-21 21:15:28 -08:00
Alex Crichton
f7df57c5c9 Add a special case for empty /* comments
Looks like they didn't fall into quite the right position!

Closes #57
2018-01-21 21:05:11 -08:00
Alex Crichton
8c03033828 Fix a panic in cooked_byte on utf-8 chars
Don't want to slice on the wrong boundary!

Closes #54
2018-01-16 08:07:36 -08:00
David Tolnay
36931ed936
Bump to 0.2.1 2018-01-08 14:05:54 -08:00
David Tolnay
9008f9cb5f
Merge pull request #51 from mystor/truefalse_lit
true and false should not be parsed as literals, and should instead be parsed as terms
2018-01-08 14:05:12 -08:00
Nika Layzell
7b3bb04f3e true and false should not be parsed as literals, and should instead be parsed as terms 2018-01-08 17:01:56 -05:00
David Tolnay
34231875b8
Bump to 0.2.0 2018-01-08 08:05:26 -08:00
David Tolnay
15cc498f9e
Set html_root_url 2018-01-08 08:03:27 -08:00
David Tolnay
ee04a5d846
Merge pull request #50 from alexcrichton/breaking
Breaking changes for 0.2
2018-01-08 08:01:39 -08:00
David Tolnay
1b5788f98a
Remove 'unstable' cfg 2018-01-08 07:48:53 -08:00