-
-
Save matklad/5725e97192363c973c985e3d765d7fbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16:41:51|~/tmp | |
λ cat main.rs | |
use | |
fn main() {} | |
16:42:06|~/tmp | |
λ rustc +nightly -Z ast-json main.rs | |
error: expected identifier, found keyword `fn` | |
--> main.rs:3:1 | |
| | |
3 | fn main() {} | |
| ^^ expected identifier, found keyword | |
error: expected one of `::`, `;`, or `as`, found `main` | |
--> main.rs:3:4 | |
| | |
3 | fn main() {} | |
| ^^^^ expected one of `::`, `;`, or `as` | |
error: aborting due to 2 previous errors | |
16:42:08|~/tmp | |
λ ~/projects/rust-analyzer/target/release/ra_cli parse < main.rs | |
SOURCE_FILE@[0; 18) | |
USE_ITEM@[0; 3) | |
USE_KW@[0; 3) "use" | |
WHITESPACE@[3; 5) "\n\n" | |
FN_DEF@[5; 17) | |
FN_KW@[5; 7) "fn" | |
WHITESPACE@[7; 8) " " | |
NAME@[8; 12) | |
IDENT@[8; 12) "main" | |
PARAM_LIST@[12; 14) | |
L_PAREN@[12; 13) "(" | |
R_PAREN@[13; 14) ")" | |
WHITESPACE@[14; 15) " " | |
BLOCK_EXPR@[15; 17) | |
BLOCK@[15; 17) | |
L_CURLY@[15; 16) "{" | |
R_CURLY@[16; 17) "}" | |
WHITESPACE@[17; 18) "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment