aboutsummaryrefslogtreecommitdiff
path: root/syn/examples/dump-syntax/README.md
blob: 37c84d80255dd4d27be6dd7fe9b90554ba1e8082 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Parse a Rust source file into a `syn::File` and print out a debug representation
of the syntax tree.

Use the following command from this directory to test this program by running it
on its own source code:

```
cargo run -- src/main.rs
```

The output will begin with:

```
File {
    shebang: None,
    attrs: [
        Attribute {
            pound_token: Pound,
            style: Inner(
                Bang
            ),
            bracket_token: Bracket,
            path: Path {
                leading_colon: None,
                segments: [
    ...
}
```