Commit Graph

163 Commits

Author SHA1 Message Date
veetaha
972d3b2ba3 Group generated ast boilerplate apart from the interesting part 2020-04-18 23:51:13 +03:00
veetaha
21b98d585e Refucktor codegen 2020-04-18 21:46:24 +03:00
Benjamin Coenen
828f69ce54 tests: add more info about what failed in tidy tests
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-17 10:32:12 +02:00
Timo Freiberg
1231418f31 Change add_function assist to use todo!() 2020-04-13 22:17:06 +02:00
Aleksey Kladov
5e5eb6a108 Align grammar for record patterns and literals
The grammar now looks like this

   [name_ref :] pat
2020-04-12 00:00:15 +02:00
Chris Hopman
af04d45d32 Change missing impl assist to use todo!() instead of unimplemented()
todo!() "Indicates unfinished code" (https://doc.rust-lang.org/std/macro.todo.html)

Rust documentation provides further clarification:

> The difference between unimplemented! and todo! is that while todo!
> conveys an intent of implementing the functionality later and the
> message is "not yet implemented", unimplemented! makes no such claims.

todo!() seems more appropriate for assists that insert missing impls.
2020-04-10 13:56:12 -07:00
Aleksey Kladov
c476742f47 Simplify 2020-04-10 17:47:49 +02:00
Aleksey Kladov
5c5bde47fb Rename some tokens 2020-04-10 17:07:09 +02:00
Aleksey Kladov
d4332760d8 Better readability 2020-04-10 16:10:28 +02:00
Aleksey Kladov
e0f02d233f Remove dead code 2020-04-10 16:10:28 +02:00
Aleksey Kladov
4560fe2abf Generate only minimal set of ineresting tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
8d71a6bf0c Scale token generation back 2020-04-10 16:10:28 +02:00
Aleksey Kladov
779f06ed77 Convert more tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
548f562dda Other delimiters 2020-04-10 16:10:28 +02:00
Aleksey Kladov
460c8bbdec Curley tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
1c5d859195 Start replacing tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
c8b4c36f81 Semicolon token 2020-04-10 16:10:28 +02:00
Aleksey Kladov
f89f2e3885 More readable ast_src for keywords 2020-04-10 16:10:28 +02:00
Aleksey Kladov
ff5643c524 Simplify 2020-04-10 16:10:27 +02:00
Aleksey Kladov
30084a56a5 Simpler acessors for keywords 2020-04-09 23:42:01 +02:00
Aleksey Kladov
0ed27c388a Drop needless trait 2020-04-09 23:02:10 +02:00
Aleksey Kladov
2bfb65db93 Be consistent about token accesors 2020-04-09 18:48:13 +02:00
Aleksey Kladov
e6d22187a6 Add _token suffix to token accessors
I think this makes is more clear which things are : AstNode and which
are : AstToken
2020-04-09 18:25:36 +02:00
Aleksey Kladov
56c8581b90 Put displays at the end 2020-04-09 18:11:16 +02:00
Aleksey Kladov
9285cbffb6 More compact 2020-04-09 18:08:54 +02:00
Aleksey Kladov
6fd2a12495 More compact generated code 2020-04-09 18:07:16 +02:00
Aleksey Kladov
4a063e651f Move the rest of the tokens to generated/tokens 2020-04-09 17:58:15 +02:00
Aleksey Kladov
c80795e274 Move generated tokens to a separate file 2020-04-09 17:47:46 +02:00
Aleksey Kladov
59b6b2278b Start ast/generated/tokens 2020-04-09 16:25:06 +02:00
Aleksey Kladov
d61932ef7e Prepare for spliting generated into tokens and nodes 2020-04-09 16:17:18 +02:00
Aleksey Kladov
0fc8c5cca0 Reduce visibility 2020-04-09 15:49:17 +02:00
Aleksey Kladov
6379061e21 Cleanup import 2020-04-09 15:47:48 +02:00
Aleksey Kladov
689661c959 Scale back to only two traits 2020-04-09 13:00:09 +02:00
Luca Barbieri
60f4d7bd8c Provide more complete AST accessors to support usage in rustc 2020-04-09 11:50:37 +02:00
Aleksey Kladov
8f01e62bb9 Scale back the traits 2020-04-09 11:04:18 +02:00
Luca Barbieri
68196ccc10 Add AstElement trait, generate tokens, support tokens in enums
- Adds a new AstElement trait that is implemented by all generated
  node, token and enum structs

- Overhauls the code generators to code-generate all tokens, and
  also enhances enums to support including tokens, node, and nested
  enums
2020-04-08 17:15:12 +02:00
Aleksey Kladov
9e3c843847 fmt 2020-04-08 12:19:41 +02:00
Aleksey Kladov
ffb7ea678b Don't strip nightly releases 2020-04-08 11:47:40 +02:00
Aleksey Kladov
372e684f6e When making a release, just promote the latest nightly 2020-04-07 11:42:36 +02:00
Aleksey Kladov
da8eb29a2f Macro patterns are not confused with expressions.
We treat macro calls as expressions (there's appropriate Into impl),
which causes problem if there's expresison and non-expression macro in
the same node (like in the match arm).

We fix this problem by nesting macor patterns into another node (the
same way we nest path into PathExpr or PathPat). Ideally, we probably
should add a similar nesting for macro expressions, but that needs
some careful thinking about macros in blocks: `{ am_i_expression!() }`.
2020-04-03 16:12:38 +02:00
Aleksey Kladov
db34abeb85 Get rid of ItemOrMacro 2020-03-26 16:10:01 +01:00
Aleksey Kladov
b605271d7f Fix formatting 2020-03-23 15:20:49 +01:00
Aleksey Kladov
59f6bf87d6 Fix release 2020-03-23 14:33:44 +01:00
Josh Mcguigan
90c66470f9 gen_assists_docs skip hidden files 2020-03-21 09:39:45 -07:00
Aleksey Kladov
4b5435b52b Make from-source install use cargo installed binary by default 2020-03-20 13:07:12 +01:00
Aleksey Kladov
3d1cb5e20f Simplify extension tag sniffing 2020-03-19 09:37:03 +01:00
Aleksey Kladov
e511b3280f Make xtask dist more reliable 2020-03-18 13:23:44 +01:00
Aleksey Kladov
de7662c852 Check that no file contains trailing ws
rustfmt allows trailing spaces in string literals unfortunately.
2020-03-17 11:42:54 +01:00
Aleksey Kladov
8f6efa01b2 Tidier tidy checks 2020-03-17 10:27:09 +01:00
Aleksey Kladov
ebab250b6b Fix version 2020-03-16 13:39:13 +01:00