aboutsummaryrefslogtreecommitdiff
path: root/syn/examples/dump-syntax/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'syn/examples/dump-syntax/README.md')
-rw-r--r--syn/examples/dump-syntax/README.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/syn/examples/dump-syntax/README.md b/syn/examples/dump-syntax/README.md
new file mode 100644
index 0000000..37c84d8
--- /dev/null
+++ b/syn/examples/dump-syntax/README.md
@@ -0,0 +1,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: [
+ ...
+}
+```