Commit Graph

124 Commits

Author SHA1 Message Date
David Tolnay
d704b9c949
Ensure all features are visible on docs.rs 2018-01-06 17:47:29 -08:00
David Tolnay
9df02c4ff1
Hyphenate cargo cfgs 2018-01-06 13:52:48 -08:00
David Tolnay
d1ec6ec6a5
Move verbase-trace to a RUSTFLAGS env flag 2018-01-03 00:24:29 -08:00
David Tolnay
3cfd1d3a10
Feature gate the derive data structures 2018-01-03 00:24:25 -08:00
David Tolnay
8d1ffa3ade
Polish dump-ast example code 2018-01-01 00:17:46 -05:00
David Tolnay
1cf8091dbe
Do not depend on quote when only parsing 2017-12-31 18:35:12 -05:00
David Tolnay
c5ab8c6b9f
Merge synom into syn 2017-12-26 21:04:29 -05:00
David Tolnay
ee97dbfc2f
Run round-trip and precedence tests in parallel 2017-11-19 15:29:38 -08:00
David Tolnay
cfa5cc0382
Test with libsyntax instead of syntex 2017-11-13 01:05:11 -08:00
David Tolnay
3d6d17cc99
Do not include tests/rust/README.md and other files 2017-11-12 11:11:44 -08:00
David Tolnay
897df29220
Remove tempdir dependency
As far as I can tell, this is no longer used.
2017-11-09 22:49:19 -08:00
David Tolnay
684dd15d56
Merge pull request #216 from dtolnay/no-error-chain
Remove error-chain dependency in doc tests
2017-11-09 22:48:11 -08:00
David Tolnay
9174b97109
Remove error-chain dependency in doc tests 2017-11-09 22:27:50 -08:00
Nika Layzell
9420467353 Switch from using a cfg to specifying required-features for the example 2017-10-26 16:43:19 -04:00
Nika Layzell
a6f46c40ff Rename methods and functions to be more uniform 2017-10-26 15:30:44 -04:00
Nika Layzell
7f5fc685f5 Link to quote when only parsing is enabled as well 2017-10-26 10:38:06 -04:00
David Tolnay
c7a5d3de89 Pare down the Synom trait
I would like to make it clearer that parsing a string is second-class
functionality compared to parsing tokens.
2017-07-06 11:59:10 -07:00
Alex Crichton
f9e8f1a7d9 Update to published version of proc_macro2 2017-07-05 18:20:44 -07:00
David Tolnay
570695ea93
Require Ident to contain a valid ident 2017-06-03 18:50:41 -07:00
David Tolnay
37ea608ccf
Remove aster
Only two libraries on GitHub are using this, and both only use
a small amount of its surface area.
2017-06-03 18:50:40 -07:00
David Tolnay
d7d8ec4049
New syntex 2017-06-01 22:37:32 -07:00
Alex Crichton
7b9e02ff90 Get synom compiling again
Add a `Synom` trait along with impls for all the base types here, to be used
later.
2017-05-30 15:54:33 -07:00
Alex Crichton
1c48953726 Merge commit '416724e44537bad521ef7fc8aad7fbcb4b31be9b' into new-parse 2017-05-30 15:09:25 -07:00
David Tolnay
0421a4576d
Use the master branch of quote 2017-05-26 16:46:46 -07:00
David Tolnay
caf1757c74
Disable publish until proc-macro2 is figured out 2017-05-26 16:42:55 -07:00
Alex Crichton
ccbb45dd92 Rewrite tokenization with proc-macro2 tokens
This ended up being a bit larger of a commit than I intended! I imagine that
this'll be one of the larger of the commits working towards #142. The purpose of
this commit is to use an updated version of the `quote` crate which doesn't work
with strings but rather works with tokens form the `proc-macro2` crate. The
`proc-macro2` crate itself is based on the proposed API for `proc_macro` itself,
and will continue to mirror it. The hope is that we'll flip an easy switch
eventually to use compiler tokens, whereas for now we'll stick to string parsing
at the lowest layer.

The largest change here is the addition of span information to the AST. Building
on the previous PRs to refactor the AST this makes it relatively easy from a
user perspective to digest and use the AST still, it's just a few extra fields
on the side. The fallout from this was then quite large throughout the
`printing` feature of the crate. The `parsing`, `fold`, and `visit` features
then followed suit to get updated as well.

This commit also changes the the semantics of the AST somewhat as well.
Previously it was inferred what tokens should be printed, for example if you
have a closure argument `syn` would automatically not print the colon in `a: b`
if the type listed was "infer this type". Now the colon is a separate field and
must be in sync with the type listed as the colon/type will be printed
unconditionally (emitting no output if both are `None`).
2017-05-26 13:59:06 -07:00
Michael Layzell
416724e445 Parse based on proc-macro2 2017-05-24 21:12:34 -04:00
Alex Crichton
2e0229cd93 Move all #[derive] impls behind Cargo feature gates
This commit moves all #[derive] annotations behind Cargo feature gates to add
the ability to strip them all out entirely. The `Clone` and `Copy` impls
continue to be enabled by default as they tend to be mega useful but other
equality/hash/debug impls are all default behind the `extra-impls` gate.

This commit, on my computer, has the following timings:

| features                      | before  | after
|-------------------------------|---------|------
| default                       | 3.67    | 2.96
| *none*                        | 1.78    | 0.49
| {printing, parsing}           | 3.71    | 2.57
| default + {full}              | 8.50    | 6.31
| {full}                        | 3.53    | 0.70
| {full, printing, parsing}     | 8.10    | 5.29

Closes #143
2017-05-23 10:59:24 -07:00
David Tolnay
2134cc20d4
Release 0.11.11 2017-04-20 10:12:33 -07:00
David Tolnay
90c07ea3a4
Release 0.11.10 2017-04-02 21:32:46 -07:00
Demur Rumed
d6bcd6a0f3 Replace time with std::time 2017-03-12 21:50:39 +00:00
David Tolnay
5e42499da9
Release 0.11.9 2017-03-06 08:41:44 -08:00
Simon Sapin
ec3cb0d26a Parse ConstExpr::Other 2017-02-27 12:28:47 +01:00
Simon Sapin
6f346b7184 quote 0.3.7 is required, syn’s test uses Tokens::as_str
This only affects running tests with an old Cargo.lock file
2017-02-27 12:06:42 +01:00
David Tolnay
f8ed9a990e
Release 0.11.7 2017-02-27 02:27:41 -08:00
David Tolnay
2ce94ed368
Release 0.11.6 2017-02-19 13:08:30 -08:00
David Tolnay
3150dfbf4e
Revert "Link to docs.rs for documentation"
This reverts commit 75abf456f9.
2017-02-19 13:00:54 -08:00
David Tolnay
337409962f
Remove clippy dependency to eliminate cycle 2017-02-19 12:30:14 -08:00
David Tolnay
b7defb7ebe
Release 0.11.5 2017-02-19 11:50:57 -08:00
David Tolnay
75abf456f9
Link to docs.rs for documentation
Fixes #95.
2017-02-19 11:49:34 -08:00
David Tolnay
ba08328052
Include readme and licenses in crates.io archive
Fixes #96.
2017-02-19 11:46:43 -08:00
Igor Gnatenko
2449b76497 Cargo.toml: bump syntex_* deps to latest (0.58.0) version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-02-18 18:49:35 +01:00
David Tolnay
32c962e21d
Add procedural-macro-helpers category
cc https://github.com/rust-lang/crates.io/pull/545
2017-02-09 18:27:36 -08:00
David Tolnay
62f68a634c Merge pull request #85 from gnzlbg/folder
Implement Folder
2017-01-29 11:09:26 -08:00
gnzlbg
9ae88d862d Implement Folder 2017-01-29 16:35:27 +01:00
David Tolnay
5fe14fc3b7
Touch up the exposed parsers 2017-01-27 16:29:25 -08:00
Michael Layzell
5bde96feb4 Move the internal nom implementation into a seperate syn_nom crate 2017-01-27 12:30:23 -05:00
David Tolnay
b67c0b70ee
Release 0.11.4 2017-01-25 16:01:01 -08:00
David Tolnay
b95f685baf
Release 0.11.3 2017-01-25 15:53:51 -08:00
David Tolnay
3503af76ac
Release 0.11.2 2017-01-25 15:42:00 -08:00