Commit Graph

221 Commits

Author SHA1 Message Date
Carl Lerche
cbf7cc1b02
Reclasify Ident and Span as being from proc_macro2 2019-02-15 14:09:31 -08:00
David Tolnay
d307657bfc
Use syn and proc_macro2 keys in json 2019-02-15 13:34:10 -08:00
David Tolnay
157c7eb18d
Remove redundancy about tokens in json 2019-02-15 13:34:09 -08:00
David Tolnay
f9bb8fff84
Include token types in json file 2019-02-15 13:34:08 -08:00
David Tolnay
295141bb59
Reduce json nesting 2019-02-15 13:34:07 -08:00
Carl Lerche
9a7d588862
Generate JSON file of all syn types
The JSON file can be used by third party libs to build tools that
consume `syn` types.
2019-02-15 12:27:04 -08:00
Carl Lerche
058ff475e8
Rewrite codegen
The primary purpose is to split up parsing the `syn` source from
generating visit / visit_mut / fold.

The commit defines an intermediate representation of syn's internal
types. The first step is then to parse the syn source and construct the
intermediate representation. Then, code is generated using the IR.

This change is a precursor to generating a JSON version of the IR.
2019-02-15 09:53:42 -08:00
David Tolnay
881171adc3
Make codegen crate a distinct workspace 2019-02-09 01:16:41 +01:00
David Tolnay
531603545f
Normalize doc attributes in generated code 2019-02-07 23:36:21 +01:00
David Tolnay
cdf76eb102
Use Path::is_ident in codegen crate 2018-11-24 14:54:33 -08:00
David Tolnay
5f794803af
Format with rustfmt 1.0.0-nightly 2018-11-24 14:52:07 -08:00
David Tolnay
c1f557908a
Remove lints that are no longer triggering 2018-11-21 01:57:15 -08:00
David Tolnay
9d7622b04a
Ignore trivially_copy_pass_by_ref lint in generated code 2018-11-21 01:57:13 -08:00
David Tolnay
9a51814296
Resolve lints in codegen crate 2018-11-21 01:38:50 -08:00
David Tolnay
c8d3e4abd2
Move codegen to tool attributes 2018-11-21 01:36:58 -08:00
David Tolnay
b28acf3656
Release 0.15.0 2018-09-06 09:01:40 -07:00
David Tolnay
2a22a56920
Fix syn dependency in codegen crate 2018-09-01 20:47:00 -07:00
David Tolnay
78b1614ea1
Simplify path_eq 2018-09-01 16:53:07 -07:00
David Tolnay
86cb945582
Fix codegen subcrate 2018-08-31 10:35:14 -07:00
David Tolnay
64f038412b
Reimplement codegen parsing 2018-08-30 22:08:27 -07:00
David Tolnay
46f0a4c9fe
Update codegen attribute parsers 2018-08-26 08:49:00 -04:00
David Tolnay
1b160957c4
Merge branch master into next 2018-08-26 08:35:36 -04:00
David Tolnay
7fef3d99d4
Pull in rustfmt from git 2018-08-26 08:34:57 -04:00
David Tolnay
7ac699ce5a
Move spans of tokens to a named field 2018-08-24 15:58:41 -04:00
David Tolnay
4f33831175
Drop an old git dependency on quote 2018-08-14 10:23:02 -07:00
David Tolnay
58c5d5ba10
Pick up a rustfmt that works on latest nightly 2018-08-14 10:22:32 -07:00
David Tolnay
b7ccc4f0a4
Simplify reparse step in parsing AstEnumOfStructs 2018-08-02 00:41:32 -07:00
David Tolnay
280202f228
Format macro matchers in generated code 2018-08-02 00:29:54 -07:00
David Tolnay
bc5b2c0ce4
Simplify iteration of struct fields in codegen 2018-08-02 00:18:23 -07:00
David Tolnay
6b46a7064d
Clean up clippy in the codegen crate 2018-08-01 23:51:32 -07:00
David Tolnay
6af48996d8
Change codegen to build code as tokens 2018-08-01 23:43:19 -07:00
David Tolnay
ae0009e5f3
Format codegen with rustfmt 0.9.0 2018-08-01 00:40:00 -07:00
David Tolnay
8c81f628f3
Format generated code through rustfmt 2018-07-31 23:34:35 -07:00
David Tolnay
d228b33fb1
Fix clippy lints 2018-06-28 00:00:24 -07:00
hcpl
aa51179851 Replace TokenStream::empty with ::new
`TokenStream::empty` is deprecated since `proc-macro2` 0.4.4.
2018-05-29 07:22:54 +03:00
David Tolnay
a23b443971
Fix default fold_ident of raw identifiers 2018-05-20 20:38:44 -07:00
David Tolnay
d3f32141c6
Fix unused fold macro 2018-05-20 20:21:20 -07:00
David Tolnay
01ed0ce1b1
Format codegen crate with rustfmt 0.7.0 2018-05-20 20:18:28 -07:00
David Tolnay
18837696e5
Fold span inside of Ident 2018-05-20 20:18:28 -07:00
David Tolnay
94dea10aa5
Ident import is always required 2018-05-20 20:18:28 -07:00
David Tolnay
a6f7917911
Update to quote 0.6 from crates.io 2018-05-20 19:42:57 -07:00
David Tolnay
446f7d6da0
Eliminate to_string() in Ident comparisons 2018-05-20 18:09:51 -07:00
David Tolnay
e303b7c74e
Preserve syn::Ident as a re-export 2018-05-20 17:22:58 -07:00
Alex Crichton
131308ca4d
Add a span to the apostrophe in Lifetime 2018-05-20 16:41:41 -07:00
Alex Crichton
d261d0954c
Add back fold_ident 2018-05-20 16:41:41 -07:00
Alex Crichton
715862b729
Fix codegen 2018-05-20 16:41:41 -07:00
Alex Crichton
2b3433ecae
Update codegen Cargo.toml 2018-05-20 16:41:41 -07:00
Alex Crichton
a74a1c89fd Update to the next version of proc-macro2
Depends on dtolnay/quote#73
Depends on alexcrichton/proc-macro2#90
Depends on a new nightly
2018-05-17 10:38:43 -07:00
David Tolnay
8908a0b54e
Update syn_codegen to quote 0.5 2018-03-31 23:14:32 +02:00
Alex Crichton
9a4dca26c9
Update to proc-macro2 0.3 and tweak apis 2018-03-31 16:55:52 +02:00
David Tolnay
96c6fbe2cc
Allow cond_reduce without a sub parser 2018-01-11 17:52:01 -08:00
David Tolnay
890f29837a
Update syn-codegen to quote 0.4 2018-01-08 08:46:24 -08:00
David Tolnay
461d98ee7c
Document what feature everything requires 2018-01-07 11:07:19 -08:00
David Tolnay
ded2d687c3
Documentation of the syntax tree traversals 2018-01-06 18:53:53 -08:00
David Tolnay
5608068454
Rename one of the two meanings of 'item' 2018-01-06 14:01:52 -08:00
David Tolnay
4b4c4b6708
Briefer ast traversal trait names 2018-01-06 13:48:05 -08:00
David Tolnay
0a0d78cff0
Fill in missing cfgs 2018-01-05 15:24:01 -08:00
David Tolnay
360efd23b8
More useful literal api 2018-01-05 14:22:13 -08:00
David Tolnay
6eff4da01d
Iterate over items by default in Punctuated 2018-01-01 20:48:41 -08:00
David Tolnay
bdafb10843
Rename fields to avoid repetition 2018-01-01 20:04:27 -08:00
David Tolnay
01a7758d5f
Avoid trying to parse TokenStream outside of a proc macro 2018-01-01 20:00:51 -08:00
David Tolnay
1cf8091dbe
Do not depend on quote when only parsing 2017-12-31 18:35:12 -05:00
David Tolnay
f2cfd72935
Punctuated 2017-12-31 18:14:35 -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
f047c7a1cc
Update codegen with Delimiter changes 2017-12-31 02:29:04 -05:00
David Tolnay
6702adeab0
Avoid conflicting imports in generated code 2017-12-30 23:38:15 -05:00
David Tolnay
ab9195198b
Separate delimiter and tokenstream in macro ast 2017-12-30 23:31:51 -05:00
David Tolnay
fe9d278f84
Standardize on tt name for tokens 2017-12-29 11:32:42 -05:00
David Tolnay
323279a79c
Expand Type::Macro and Pat::Macro into real variants 2017-12-29 11:31:04 -05:00
David Tolnay
fe5e2efd12
Move syn_codegen to just codegen 2017-12-29 02:44:08 -05:00