David Tolnay
fe58b5a725
Represent crate
visibility specifier
2018-03-31 18:24:09 +02:00
Alex Crichton
9a4dca26c9
Update to proc-macro2 0.3 and tweak apis
2018-03-31 16:55:52 +02:00
David Tolnay
5d1a3ee883
Set up libsyntax globals for tests
2018-03-17 19:41:36 -07:00
David Tolnay
e913492b3a
Merge pull request #371 from ignatenkobrain/patch-1
...
deps: update walkdir to 2
2018-03-17 13:05:47 -07:00
David Tolnay
54bdb4f2a8
Clean up redundant_field_names lint in tests
2018-03-17 13:00:45 -07:00
Igor Gnatenko
951a52be05
deps: update walkdir to 2
...
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-03-12 10:44:09 +01:00
David Tolnay
4755104910
Update respan to nightly-2018-02-25
2018-02-25 23:52:47 -08:00
Bastien Orivel
340553a5e0
Allow '_ to be parsed as a lifetime
2018-02-15 23:57:38 +01:00
Bastien Orivel
9ea503330e
Make Attribute::interprete_meta understand booleans
...
So proc_macro2::Literal doesn't have any boolean related variant which
means that a boolean value is put in a TokenNode::Term and not a
TokenNode::Literal which in turn means that those values were ignored
and resulted in an impossibility to parse booleans in an attribute.
Fixes #346
2018-01-23 17:43:11 +01:00
David Tolnay
5dec63d6d3
Bump the rust-lang/rust commit we test against
2018-01-18 23:36:12 -08:00
David Tolnay
bd27aac4f0
Unblacklist some tests that we now support
2018-01-18 23:25:35 -08:00
David Tolnay
c42b90a763
Support attributes on FieldValue
...
This is like:
let mut ctx = Blake2bCtx {
b: [0; 128],
finalized: false,
#[cfg(debug_assertions)]
fnv_hash: 0xcbf29ce484222325,
};
2018-01-18 23:11:43 -08:00
Sean Griffin
dadd0b3132
Remove fields_mut
, replace fields()
with fields.iter()
2018-01-16 10:35:40 -07:00
Sean Griffin
ca93a776d0
Bring back VariantData::fields
and VariantData::fields_mut
...
These methods were removed in syn 0.12. They seem like an odd removal,
since they're pretty widely used in the wild. This adds these methods
back. Though `Fields` is the closest structurally to `VariantData`, I've
opted to put it on `DataStruct` instead, as it's in the location most
people will look for it. `fields.fields()` also reads really poorly.
Fixes #316
2018-01-15 13:33:17 -07:00
David Tolnay
66bb8d51c4
Update to quote 0.4
2018-01-08 08:25:38 -08:00
David Tolnay
aaadd78b96
Redesign MetaItem naming
2018-01-06 22:58:13 -08:00
David Tolnay
d5ddbb4e13
Fix TokenBuffer constructor in tests
2018-01-06 18:55:45 -08:00
David Tolnay
1f0b7b8e9b
Box in stmt is no longer required
2018-01-06 16:15:22 -08:00
David Tolnay
eb75206fee
Rename test fold implementations
2018-01-06 13:51:42 -08:00
David Tolnay
dfc886ba94
Move Cursor and TokenBuffer into buffer module
2018-01-06 08:04:58 -08:00
David Tolnay
76ebcdd9bf
Address clippy lints
2018-01-05 17:07:26 -08:00
David Tolnay
555350115f
Add license boilerplate to source files
2018-01-05 16:39:26 -08:00
David Tolnay
61037c6584
Format with rustfmt
2018-01-05 16:21:47 -08:00
David Tolnay
360efd23b8
More useful literal api
2018-01-05 14:22:13 -08:00
David Tolnay
40fb8ce1a6
Eliminate PolyTraitRef
2018-01-02 10:53:46 -08:00
David Tolnay
a0834b46d6
Polish Punctuated api
2018-01-01 21:30:02 -08:00
David Tolnay
d4add859c2
Improve naming in WherePredicate
2018-01-01 20:13:24 -08:00
David Tolnay
bdafb10843
Rename fields to avoid repetition
2018-01-01 20:04:27 -08:00
David Tolnay
f2cfd72935
Punctuated
2017-12-31 18:14:35 -05:00
David Tolnay
f4aa6b4946
Put remaining cursor last
2017-12-31 16:42:03 -05:00
David Tolnay
e3d41b7678
Reorganize DeriveInput
2017-12-31 15:27:17 -05:00
David Tolnay
8875fcaba8
Parse delimiter before contents
2017-12-31 13:52:37 -05:00
David Tolnay
3bc597fc3f
Fix unneeded into()
2017-12-31 02:34:52 -05:00
David Tolnay
dd12556f30
Create 'delimited!' macro for tests
2017-12-31 02:16:22 -05:00
David Tolnay
8b4d3028d2
Collapse parallel Option fields in exprs
2017-12-29 12:11:50 -05:00
David Tolnay
2ae520adce
Add verbatim variants as an escape hatch
2017-12-29 11:21:46 -05:00
David Tolnay
eadbda37d2
Type field renames
2017-12-29 02:33:47 -05:00
David Tolnay
24237fb37b
Inline mutability as just a token
2017-12-29 02:17:32 -05:00
David Tolnay
d60cfec71b
Support method turbofish with const generics
2017-12-29 00:24:29 -05:00
David Tolnay
2a86fdd660
Rename array and tuple exprs to have 'elems'
2017-12-28 23:36:45 -05:00
David Tolnay
8701a5cb77
Remove old placement syntax
2017-12-28 23:31:10 -05:00
David Tolnay
8c91b888d7
Combine Expr and ExprKind
2017-12-28 23:12:26 -05:00
David Tolnay
e67902a72a
Flatten discriminant into one field
2017-12-28 22:14:41 -05:00
David Tolnay
fcfb900cad
Remove empty VisInherited type
2017-12-28 22:08:06 -05:00
David Tolnay
ac997ddc37
Make WhereClause always hold a where
token
2017-12-27 23:24:03 -05:00
David Tolnay
d587e7331e
Remove lone_comma in favor of trailing delimiter in Delimited
2017-12-27 23:02:35 -05:00
David Tolnay
85b69a46e8
Combine Expr::Field and Expr::TupleField into one variant
2017-12-27 20:46:59 -05:00
David Tolnay
d0b4b9661b
Rename TupField to TupleField in tests
2017-12-27 19:48:51 -05:00
David Tolnay
5138205475
Format with rustfmt 0.3.4-nightly
2017-12-27 13:46:21 -05:00
David Tolnay
c5f1a6550d
Clean up Vec<TokenTree> in tests
2017-12-27 02:10:10 -05:00
David Tolnay
9c76bcbe16
Use TokenTree straight from proc_macro2
2017-12-27 01:25:13 -05:00
David Tolnay
42eaae1f24
Rename 'tokens' to 'token' in tests
2017-12-26 23:05:18 -05:00
David Tolnay
9894256d73
Use proc-macro2's Span instead of our own
2017-12-26 21:37:25 -05:00
David Tolnay
c5ab8c6b9f
Merge synom into syn
2017-12-26 21:04:29 -05:00
David Tolnay
3cede94385
Resolve clippy lints in tests
2017-12-26 12:29:24 -05:00
David Tolnay
d079773783
Fix Tup -> Tuple in tests
2017-12-26 01:46:12 -05:00
David Tolnay
dfc6df7274
Parse crate in paths
2017-12-25 23:44:08 -05:00
David Tolnay
d9faf44138
Parse where-clause with parens
2017-12-25 23:36:05 -05:00
David Tolnay
ed8716e3d0
Move clone.sh out of tests/rust
...
To avoid spurious diffs in Travis from the cached tests/rust directory.
2017-12-25 21:49:47 -05:00
David Tolnay
ecce832e34
2.0 macro definitions no longer need to be excluded
2017-12-25 21:42:04 -05:00
David Tolnay
b0d21415ad
Bump the commit we test against
2017-12-25 21:31:58 -05:00
David Tolnay
3eaf7d88a5
Abort more promptly on test failure
2017-12-17 23:14:52 -08:00
David Tolnay
ec5b52e9c8
Avoid interleaving errorf in tests
2017-12-17 22:42:32 -08:00
David Tolnay
e959425c39
Use syntax_pos::FileName
2017-12-17 21:53:42 -08:00
Nika Layzell
6bd368177a
Also support parsing where clauses in trait associated types
2017-12-05 13:46:07 -05:00
Nika Layzell
b49a9e539e
Support trailing + when parsing trait objects
2017-12-05 13:31:52 -05:00
Nika Layzell
25231e85d7
Add some simple should_parse tests
2017-12-05 12:48:07 -05:00
Nika Layzell
c08227a5f9
Improve the consistency of type naming
2017-12-04 16:30:17 -05:00
Nika Layzell
357885acd3
Update generic arguments to be stored similar to generic parameters
2017-12-04 15:47:07 -05:00
Nika Layzell
3aa0dc7e0c
Add an explicit precedence test
2017-12-04 13:41:28 -05:00
Nika Layzell
640832aa1c
Separate unsafe blocks into a ExprKind variant
2017-12-04 13:37:09 -05:00
David Tolnay
c2f1aba7c3
Groundwork for const generics
2017-11-19 15:58:57 -08:00
David Tolnay
ee97dbfc2f
Run round-trip and precedence tests in parallel
2017-11-19 15:29:38 -08:00
David Tolnay
11e6da97ac
Script to clone the rust-lang/rust repo
2017-11-19 12:19:51 -08:00
David Tolnay
1590f11bc2
Log output when tests/rust already exists
2017-11-19 11:13:37 -08:00
David Tolnay
55d9ff79f6
Clean up unused imports in tests
2017-11-19 10:42:47 -08:00
Nika Layzell
a2a1a4a979
Get syn tests passing with libsyntax instead of syntex
2017-11-19 11:33:17 -05:00
David Tolnay
cfa5cc0382
Test with libsyntax instead of syntex
2017-11-13 01:05:11 -08:00
David Tolnay
fd6bf5c8a7
Rename Ty -> Type
...
Rust source code does not abbreviate type -> ty (the way it abbreviates impl and
mod, for example). This commit updates the naming in syn to reflect that.
2017-11-12 10:34:57 -08:00
David Tolnay
f8db7ba280
Token macros
2017-11-12 09:11:52 -08:00
David Tolnay
c6b55bcbe4
Flatten ItemKind into an Item enum
...
Side note: this pattern is sort of nice:
let item: &Item = /* ... */;
match *item {
Item::Mod(ref item) => {
do_something_with(&item.ident, &item.content);
}
Item::Fn(ref item) => {
do_something_with(&item.abi, &item.block);
}
/* ... */
}
Basically pattern matching on an `item` and rebinding the same name `item`
just takes your variable and imbues it with those additional fields that exist
on the type of item that it happens to be.
2017-11-09 23:05:43 -08:00
Nika Layzell
a6f46c40ff
Rename methods and functions to be more uniform
2017-10-26 15:30:44 -04:00
Nika Layzell
956d2b727b
Update fold implementation in test_precedence
2017-10-26 10:38:06 -04:00
Alex Crichton
10143d008f
Ignore a failing test in precedence tests
2017-08-28 10:57:23 -07:00
Alex Crichton
22b82c264a
More unused crates
2017-08-28 09:56:41 -07:00
Alex Crichton
e21116fab0
Update rust submodule, add some new whitelisted failures
2017-08-28 09:56:12 -07:00
Alex Crichton
3956789d82
Annotate TODO with what syntax needs to be parsed
2017-08-28 09:55:44 -07:00
Alex Crichton
6498031ec4
Remove unused crates
2017-08-28 09:55:02 -07:00
Alex Crichton
8637477c03
Remove rust
as a submodule
...
This removes the `tests/rust` submodule and instead moves to lazily cloning it
during tests. This helps work around the fact that git dependencies on `syn`
will pull in all submodules, and rust takes forever to clone. In short, the
intention here is to make git dependencies on `syn` bearable to avoid Cargo
auto-cloning submodules.
2017-07-07 20:42:15 -07: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
605643b683
Fix test fallout from proc_macro2
2017-07-05 18:35:14 -07:00
Alex Crichton
f9e8f1a7d9
Update to published version of proc_macro2
2017-07-05 18:20:44 -07:00
Michael Layzell
57d5de7662
Update test_derive_input due to constexpr changes
2017-06-08 11:11:21 -04:00
Michael Layzell
1107ef3fce
Merge pull request #173 from mystor/macroinput
...
Remove the MacroInput type alias
2017-06-07 23:08:39 -04:00
Michael Layzell
f598c5c40d
Update test_macro_input to test_derive_input
2017-06-07 17:55:43 -04:00
Michael Layzell
188ba81d1f
Update test_round_trip to share code with test_precedence
2017-06-07 09:22:14 -04:00
Michael Layzell
53fc31a9f9
Add a test to check our parsing precedence matches that of syntex
2017-06-07 09:21:53 -04:00
Michael Layzell
be1e24d90b
Add a test for grouping expressions with None-delimited sequences
2017-06-05 00:10:34 -04:00
Michael Layzell
1f506c0628
try-macro.rs now succeeds due to precedence changes
2017-06-05 00:10:34 -04:00
Michael Layzell
6a5a164c8f
Correctly parse InPlace <- expressions
2017-06-05 00:10:34 -04:00
Michael Layzell
517fe42a46
Add an environment variable to make debugging test_round_trip easier
2017-06-04 20:16:33 -04:00
David Tolnay
63e3dee53a
Do not use Ident to represent Lifetime
2017-06-03 20:17:01 -07:00
Michael Layzell
c864f027eb
Add a test to ensure that we round-trip literals faithfully
2017-06-03 13:02:41 -04:00
Michael Layzell
85f61a55f3
Enable round-trip tests for 128-bit integers
...
We support parsing these now due to
https://github.com/alexcrichton/proc-macro2/issues/6 and
https://github.com/alexcrichton/proc-macro2/pull/8 .
2017-06-03 11:54:59 -04:00
Michael Layzell
65f15262ff
Update tests to use Cursor
2017-06-03 11:37:35 -04:00
David Tolnay
d7d8ec4049
New syntex
2017-06-01 22:37:32 -07:00
David Tolnay
75a1d4a8be
Joint token in test
2017-06-01 22:23:08 -07:00
Michael Layzell
b08f94da99
Update test_meta_item for removal of IResult
2017-06-01 00:45:02 -04:00
Alex Crichton
954046cda3
Finish porting to the Synom
trait
2017-05-31 16:00:01 -07:00
Alex Crichton
1c48953726
Merge commit '416724e44537bad521ef7fc8aad7fbcb4b31be9b' into new-parse
2017-05-30 15:09:25 -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
Alex Crichton
62a0a59af3
Rewrite the AST to be a bit more user-friendly
...
This commit is a relatively large rewrite of the AST that `syn` exposes. The
main change is to expose enums-of-structs rather than
enums-with-huge-tuple-variants. The best example of this is `ItemKind::Fn` which
changed from:
enum ItemKind {
Fn(Box<FnDecl>, Unsafety, Constness, Option<Abi>, Generics, Box<Block>),
...
}
to
enum ItemKind {
Fn(ItemFn),
...
}
struct ItemFn {
decl: Box<FnDecl>,
unsafety: Unsafety,
constness: Constness,
abi: Option<Abi>,
generics: Generics,
block: Box<Block>,
}
This change serves a few purposes:
* It's now much easier to add fields to each variant of the ast, ast struct
fields tend to be "by default ignored" in most contexts.
* It's much easier to document what each field is, as each field can have
dedicated documentation.
* There's now canonicalized names for each field (the name of the field) which
can help match `match` statements more consistent across a codebase.
A downside of this representation is that it can be a little more verbose to
work with in `match` statements and during constructions. Overall though I'd
feel at least that the readability improved significantly despite the extra
words required to do various operations.
Closes #136
2017-05-23 09:01:03 -07:00
Ted Driggs
054abbb0da
Added FromStr implementations to mirror the parse_* functions
...
Also added #[deprecated] to parse_macro_input to pop warnings for those still using it.
2017-05-01 12:20:52 -07:00
Arnavion
d32b29499f
Update visibility
rule for stabilized pub(restricted)
syntax.
...
Fixes #118
2017-04-29 17:18:02 -07:00
David Tolnay
0e94f0ebc4
Merge pull request #128 from Arnavion/half-open-pat
...
Support parsing half-open ranges in patterns.
2017-04-29 17:01:51 -07:00
Arnavion
1992e2f68f
Support parsing half-open ranges in patterns.
...
Fixes #117
2017-04-25 01:47:46 -07:00
Arnavion
02ef13faf8
Support parsing catch expressions.
...
Fixes #109
2017-04-25 00:54:31 -07:00
Arnavion
f6b8bceedc
Update rust syntax to 1.18.0-nightly (ddc5d7bd4 2017-04-20)
2017-04-21 14:42:19 -07:00
Arnavion
740e8ab8b6
Consider the test a success if syntex fails to parse the original content.
2017-04-21 14:27:41 -07:00
Arnavion
67660b422f
Skip files under src/test/ui that have a corresponding .stderr file.
...
Fixes #121
2017-04-21 14:26:14 -07:00
David Tolnay
e0394902b8
Merge pull request #113 from Arnavion/round-trip
...
Small fixes for test_round_trip
2017-04-21 11:37:09 -07:00
Arnavion
f2dada15f6
fixup! Attribute paths are mod-style.
2017-04-20 23:55:20 -07:00
Arnavion
938062f3eb
Fail test_round_trip if RUST_MIN_STACK is not set to a valid value.
...
Some tests like tests/rust/src/test/run-pass/super-fast-paren-parsing.rs
require it to be atleast 16 MiB.
2017-04-20 23:54:42 -07:00
Arnavion
d6a05f7a14
Fix test_round_trip to properly ignore paths on Windows.
2017-04-20 23:54:21 -07:00
Arnavion
247706101c
fixup! Satisfy clippy some more.
2017-04-19 11:41:12 -07:00
Arnavion
95f8a7a76b
fixup! Reinstated name in MetaItem since it's no longer trivial to get it from its parent.
2017-04-19 03:29:56 -07:00
Arnavion
0b302a3a65
fixup! Test for attributes with paths.
2017-04-19 02:57:28 -07:00
Arnavion
e43b1b08f9
fixup! Attribute::name -> path
2017-04-19 02:47:45 -07:00
Arnavion
4ded3935a8
fixup! Added tests
2017-04-15 21:54:54 -07:00
Arnavion
bf395bf8c8
fixup! Only store tokens in Attribute.
2017-04-15 15:35:22 -07:00
David Tolnay
2a78fc7f2c
Run rustfmt on tests
2017-03-12 18:28:54 -07:00
David Tolnay
f093231810
Cast the one that needs to be cast
2017-03-12 18:27:52 -07:00
Demur Rumed
d6bcd6a0f3
Replace time with std::time
2017-03-12 21:50:39 +00:00
Colin Kiegel
4e76ade6ba
fix testsuite in absence of full
feature flag
...
test_macro_input::test_enum depends on `Expr` and `ExprKind`
which are behind the `full` feature flag.
2017-03-06 13:41:41 +01:00
Simon Sapin
ec3cb0d26a
Parse ConstExpr::Other
2017-02-27 12:28:47 +01:00
David Tolnay
02a8d47cea
Resolve clippy complaints
2017-02-19 12:59:44 -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
c879a50c4e
Add turbofish quoter
2017-01-25 15:51:32 -08:00
David Tolnay
23d83f9cc6
Expose TyParamBound parsing
2017-01-25 15:41:47 -08:00
David Tolnay
48088d2a0e
Drop the expander registry
2017-01-23 00:34:10 -08:00
David Tolnay
88aa978ff2
Update to syntex 0.52
2016-12-22 15:34:58 -05:00
David Tolnay
0047c71c93
Type macros
2016-12-21 22:36:10 -05:00
David Tolnay
5d55ef7943
Update rust syntax to 1.15.0-nightly (71c06a56a 2016-12-18)
2016-12-21 21:53:31 -05:00
David Tolnay
db84cb2c50
Update to syntex 0.50
2016-11-20 21:34:58 -08:00
David Tolnay
617352731b
Allow trailing comma in vec pat
2016-10-30 17:34:23 -07:00
David Tolnay
385a0f74b3
Identify reason for failing test case
2016-10-30 17:29:34 -07:00
David Tolnay
a441d3fb09
Ignore byte order mark
2016-10-30 17:12:34 -07:00
David Tolnay
e07f9e047c
Implement pub(crate) and pub(restricted)
2016-10-30 17:05:55 -07:00
David Tolnay
e4076cd9c6
Run round-trip test against the Rust repo
2016-10-30 15:40:35 -07:00
David Tolnay
67370bbd87
Propagate is_shorthand when folding syntex struct field
2016-10-30 12:08:31 -07:00
David Tolnay
b7fa2b64f1
Allow literals inside meta item lists
2016-10-30 10:50:47 -07:00
David Tolnay
003bde887b
Catch panics from syntex in test
2016-10-30 00:03:19 -07:00
David Tolnay
dec282f07e
Do not compare most literals inside macros
2016-10-27 22:19:19 -07:00
David Tolnay
a76acd4840
Single-line comparison of failure cases
2016-10-27 22:13:12 -07:00
David Tolnay
36c3ec40b4
Do not compare char literals inside a macro
2016-10-27 22:10:26 -07:00
David Tolnay
1978c673a9
Fix the rule for trailing comma in match statements
2016-10-27 22:05:52 -07:00
David Tolnay
fe373a3fa2
Allow hex escapes greater than \x7F in byte literals
2016-10-26 23:51:19 -07:00
David Tolnay
bbf4052ba6
Rustfmt the round trip test
2016-10-25 22:22:45 -07:00
David Tolnay
ec5f8a62e0
Ignore test cases containing explicit paths to modules
2016-10-25 22:21:43 -07:00
David Tolnay
b3f55907f4
Run test cases in sorted order
2016-10-25 21:51:59 -07:00
David Tolnay
107ae26fc0
Fold away spans inside of meta items
2016-10-25 21:01:54 -07:00
David Tolnay
5ca64bdb07
Ignore module errors in round trip test
2016-10-25 10:24:57 -07:00
David Tolnay
0b07f602b5
Give up on comparing strings macro tokens in round trip test
2016-10-25 10:24:54 -07:00
David Tolnay
31f1f3f96e
No need to fold normalized lits
2016-10-25 00:27:05 -07:00
David Tolnay
289f4c79ef
Use \0 for the zero char
2016-10-25 00:00:09 -07:00
David Tolnay
93413a5280
Rustfmt the tests
2016-10-24 13:02:39 -07:00
David Tolnay
c7b636a2ee
Fold away underscores and escaped newlines
2016-10-24 13:01:08 -07:00
David Tolnay
8e01a6a4f1
Copy over latest parser.rs
2016-10-24 12:09:28 -07:00
David Tolnay
4f5f60f221
Float parsing
2016-10-24 00:52:58 -07:00
David Tolnay
4a65840878
Raw byte strings
2016-10-24 00:51:53 -07:00
David Tolnay
9e24d4da46
Integrate with syntex to print expanded code
2016-10-23 22:18:45 -07:00
David Tolnay
453cfd1168
Expand custom derives
2016-10-23 20:40:47 -07:00
Simon Sapin
095a42b93b
Add parse_token_trees.
...
Token trees are much simpler than an AST.
This makes them easier to work with when they are sufficient
for the task at hand, such as for example [expanding a procedural macro](
https://github.com/servo/html5ever/pull/217 ).
2016-10-20 16:37:20 +02:00
David Tolnay
e7678920fc
Attributes on generic formals and split_for_impl
2016-10-13 20:44:03 -07:00
David Tolnay
45cc84976e
Rename to proc_macro
2016-10-08 20:52:03 -07:00
David Tolnay
2165b0452f
Large test case
2016-10-08 10:53:31 -07:00
David Tolnay
079b5ad4d9
Block comment perf
...
This is 95 times faster in debug mode for large block comments.
2016-10-08 09:53:43 -07:00
David Tolnay
6414da71fb
ObjectSum and PolyTraitRef types
2016-10-08 00:55:17 -07:00
David Tolnay
1241783c01
Fix global list ViewPath with empty path
2016-10-08 00:12:37 -07:00
David Tolnay
4a05742628
Implement use items
2016-10-08 00:02:31 -07:00
David Tolnay
19f9bdc01f
Fix discriminant in test
2016-10-07 23:07:01 -07:00
David Tolnay
359023034f
Module parsing
2016-10-06 01:11:08 -07:00
David Tolnay
4c9be37ca6
Impl parsing
2016-10-06 00:47:37 -07:00
David Tolnay
344088d1c4
Test case for array types
2016-10-05 23:30:47 -07:00
David Tolnay
15dc31f7ac
Merge branch origin/stable into origin/master
2016-10-04 23:45:14 -07:00
David Tolnay
b153dbcc91
Helper function split_impl_generics
2016-10-04 23:39:10 -07:00
David Tolnay
f94e236fcc
Default impls
2016-10-04 00:29:51 -07:00
David Tolnay
e31989394f
Trait macro semicolon fixes
2016-10-04 00:21:34 -07:00
David Tolnay
ca08542461
Trait printing
2016-10-04 00:12:38 -07:00
David Tolnay
8d9e81a3bd
Struct patterns
2016-10-03 22:36:32 -07:00
David Tolnay
aa610946d6
Tuple struct patterns
2016-10-03 22:22:49 -07:00
David Tolnay
a1aa0da0bd
Rustfmt the tests
2016-10-03 20:58:10 -07:00
David Tolnay
ffdb97f815
Reference pattern
2016-10-03 01:28:33 -07:00
David Tolnay
8b308c21bc
Literal and range patterns
2016-10-03 01:24:10 -07:00
David Tolnay
fbb7323622
Box and tuple patterns
2016-10-03 01:00:06 -07:00
David Tolnay
6ed09a4a4f
Macro span folding
2016-10-02 23:51:44 -07:00
David Tolnay
84aa0750a0
Macro parsing
2016-10-02 23:02:12 -07:00
David Tolnay
cfe5502fb3
Optional semicolon after loops
2016-10-02 22:02:27 -07:00
David Tolnay
bb6feaeae8
Looping
2016-10-02 21:25:20 -07:00
David Tolnay
29f9ce1d2b
If let
2016-10-02 20:58:40 -07:00
David Tolnay
055a704f90
Struct expressions
2016-10-02 19:23:54 -07:00
David Tolnay
191e058209
Statement parsing
2016-10-02 18:31:09 -07:00
David Tolnay
3c2467ccbe
Filling in some expression printers
2016-10-02 17:55:08 -07:00
David Tolnay
9636c0546d
Empty path segments
2016-10-02 17:18:13 -07:00
David Tolnay
89e0567333
Closure parsing
2016-10-02 14:50:33 -07:00
David Tolnay
42602293eb
Function parsing
2016-10-01 23:36:58 -07:00
David Tolnay
3cf5298445
Typedef parsing
2016-10-01 17:17:38 -07:00
David Tolnay
47a877c90f
Static and const parsing
2016-10-01 17:01:06 -07:00
David Tolnay
759d2ffd71
Boolean literals
2016-10-01 16:18:15 -07:00
David Tolnay
56d6213cbf
Byte string parsing
2016-10-01 16:14:54 -07:00
David Tolnay
14cbdeb5ca
Comment parsing
2016-10-01 15:37:12 -07:00
David Tolnay
4a51dc70fc
Round trip testing
2016-10-01 09:41:33 -07:00
David Tolnay
627e3d5328
Implement ToTokens for raw string
2016-10-01 08:27:31 -07:00
David Tolnay
210884d386
Raw string literals
2016-10-01 08:18:42 -07:00
Gregory Katz
3e562cc986
Added while loop parser and (currently ignored) tests.
2016-09-28 18:33:02 -04:00
Gregory Katz
1b69f68303
addressed review comments
2016-09-27 21:06:09 -04:00
Gregory Katz
e5f3568a7f
Added an infinite loop parser and tests.
2016-09-27 19:36:30 -04:00
David Tolnay
fa0edf2303
More expression parsing
2016-09-23 22:58:24 -07:00
David Tolnay
f38cdf6bc3
Other item kinds
2016-09-23 19:15:01 -07:00
David Tolnay
f4bbbd9f19
Expressions
2016-09-23 17:38:38 -07:00
David Tolnay
5533772670
Things needed by serde_derive
2016-09-11 17:36:30 -07:00
David Tolnay
62a8b69243
Rebrand as 'syn'
2016-09-07 08:19:28 -07:00
David Tolnay
ee89c1baa2
Test items from serde_codegen test suite
2016-09-04 16:27:18 -07:00
David Tolnay
f6ccb8370a
Fix incomplete errors
2016-09-04 15:44:15 -07:00
David Tolnay
42f5029fee
Newtype ident
2016-09-04 13:54:21 -07:00
David Tolnay
cef990c749
Parse doc comments
2016-09-04 10:21:36 -07:00
David Tolnay
7ebb9fbbfc
More nom
2016-09-03 16:32:35 -07:00
David Tolnay
35161fff39
item::parse
2016-09-03 11:33:15 -07:00