• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# syn-mid
2
3[![crates.io](https://img.shields.io/crates/v/syn-mid.svg?style=flat-square&logo=rust)](https://crates.io/crates/syn-mid)
4[![docs.rs](https://img.shields.io/badge/docs.rs-syn--mid-blue?style=flat-square)](https://docs.rs/syn-mid)
5[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg?style=flat-square)](#license)
6[![rustc](https://img.shields.io/badge/rustc-1.31+-blue.svg?style=flat-square)](https://www.rust-lang.org)
7[![build status](https://img.shields.io/github/workflow/status/taiki-e/syn-mid/CI/master?style=flat-square)](https://github.com/taiki-e/syn-mid/actions?query=workflow%3ACI+branch%3Amaster)
8
9Providing the features between "full" and "derive" of syn.
10
11This crate provides the following two unique data structures.
12
13- `syn_mid::ItemFn` -- A function whose body is not parsed.
14
15  ```text
16  fn process(n: usize) -> Result<()> { ... }
17  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^     ^
18  ```
19
20- `syn_mid::Block` -- A block whose body is not parsed.
21
22  ```text
23  { ... }
24  ^     ^
25  ```
26
27Other data structures are the same as data structures of [syn]. These are
28defined in this crate because they cannot be used in [syn] without "full"
29feature.
30
31[syn]: https://github.com/dtolnay/syn
32
33## Usage
34
35Add this to your `Cargo.toml`:
36
37```toml
38[dependencies]
39syn-mid = "0.5"
40```
41
42*Compiler support: requires rustc 1.31+*
43
44[**Examples**](examples)
45
46## Optional features
47
48- **`clone-impls`** — Clone impls for all syntax tree types.
49
50## License
51
52Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
53[MIT license](LICENSE-MIT) at your option.
54
55Unless you explicitly state otherwise, any contribution intentionally submitted
56for inclusion in the work by you, as defined in the Apache-2.0 license, shall
57be dual licensed as above, without any additional terms or conditions.
58