Commit Graph

331 Commits

Author SHA1 Message Date
Ville Penttinen
1f4468a8da Add support for parsing multiple if and while-let patterns 2019-03-04 19:10:14 +02:00
Aleksey Kladov
90122542b2 allow mut ident patterns in trait methods
closes #928
2019-03-04 17:47:02 +03:00
Aleksey Kladov
0a19f4f1b4 allow aliases in underscores
this helps with

    use foo::Trait as _;

syntax
2019-03-04 16:40:08 +03:00
bors[bot]
dc8bcc1e42 Merge #926
926: allow vararg functions r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-04 12:49:37 +00:00
Aleksey Kladov
77f2381eea improve error recovery
parse the contents of error block as an expression
2019-03-04 15:31:18 +03:00
Aleksey Kladov
a99b1db49f allow vararg functions 2019-03-04 14:34:59 +03:00
Ville Penttinen
d3ce69aee3 Remove TypeRef from item opts which implement TypeAscriptionOwner 2019-02-27 14:08:09 +02:00
Ville Penttinen
6eb070d661 Add new trait TypeAscriptionOwner
This trait should be implemented for nodes which have an ascribed type,
e.g. thing : Type. Such as let, const, static, param, named struct fields.
2019-02-26 11:35:57 +02:00
Aleksey Kladov
78f10fcdc4 rename type to type_alias in the AST as well 2019-02-25 13:49:32 +03:00
Aleksey Kladov
65a2be4953 complete struct literals 2019-02-24 17:01:56 +03:00
Aleksey Kladov
666303faf3 support upcastig in AST enum 2019-02-24 16:57:05 +03:00
Aleksey Kladov
f078f7adc8 introduce tree builder 2019-02-23 16:55:01 +03:00
Aleksey Kladov
0c1cb98182 rename 2019-02-23 16:07:29 +03:00
bors[bot]
5100aeac42 Merge #876
876: Fix join_lines not adding a comma after join_single_expr_block with match arm r=matklad a=vipentti

Fixes #868 

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-21 16:55:26 +00:00
Ville Penttinen
82173c8de4 Move non_trivia_sibling to ra_syntax::algo 2019-02-21 18:49:03 +02:00
Aleksey Kladov
4fe07a2b61 add API guide to ra_syntax 2019-02-21 17:35:45 +03:00
Aleksey Kladov
7060a39d5c simplify trait bounds 2019-02-21 16:12:15 +03:00
Aleksey Kladov
b51b71bf25 rearrange methods 2019-02-21 16:04:03 +03:00
Aleksey Kladov
f7f99af0a6 kill utils module 2019-02-21 15:57:40 +03:00
Aleksey Kladov
6225e1ab70 Ignore lockfile in fuzz
It's too much trouble maintaining it
2019-02-21 15:44:38 +03:00
Aleksey Kladov
412ac63ff5 docs 2019-02-21 15:24:42 +03:00
Aleksey Kladov
c47f9e2d37 fix compilation 2019-02-21 13:37:32 +03:00
Aleksey Kladov
d334b5a1db move parser to a separate crate 2019-02-21 13:27:45 +03:00
Aleksey Kladov
cd0d2866fc make grammar independent of syntax tree 2019-02-21 12:12:04 +03:00
Aleksey Kladov
1b2e70df99 minor 2019-02-21 12:05:52 +03:00
Aleksey Kladov
79ce0fa8d7 move whitespace handling to tree builder 2019-02-21 12:03:42 +03:00
Aleksey Kladov
882c47f187 move syntax error to parser 2019-02-20 23:17:07 +03:00
Aleksey Kladov
61992dc1cd simplify 2019-02-20 23:05:59 +03:00
Aleksey Kladov
4c1f9b8d4e remove TokenPos 2019-02-20 23:02:24 +03:00
Aleksey Kladov
cce23fddba flattern module structure 2019-02-20 22:52:32 +03:00
Aleksey Kladov
2acb21e8f7 merge parse_impl and parser_api 2019-02-20 22:44:06 +03:00
Aleksey Kladov
e72ad0a2fa fix off by one error 2019-02-20 22:27:49 +03:00
Aleksey Kladov
2b5e336ce7 move abstract traits to top 2019-02-20 22:19:12 +03:00
Aleksey Kladov
d2bce118ae switch to dynamic dispatch for TokenSource
Benchmarks show no difference. This is probably because we are
bottlenecked on memory allocations, and we should fix that, but we are
not optimizing for performance just yet.

changes. Lines starting # with '#' will be ignored, and an empty
message aborts the commit. # # On branch token-source # Changes to be
committed: # modified: crates/ra_syntax/src/parsing/parser_api.rs #
modified: crates/ra_syntax/src/parsing/parser_impl.rs #
2019-02-20 22:02:03 +03:00
Aleksey Kladov
0c81b9deee route parsing via TokenSource trait 2019-02-20 21:50:07 +03:00
Aleksey Kladov
3517c175ac rename Sink -> TreeSink 2019-02-20 21:08:59 +03:00
Aleksey Kladov
86a67dce25 fix tests 2019-02-20 16:48:06 +03:00
Aleksey Kladov
45fc91cc47 rearrange modules in a suggestd reading order 2019-02-20 16:24:39 +03:00
Aleksey Kladov
a4a1e08ab8 flatten modules 2019-02-20 16:16:14 +03:00
Aleksey Kladov
9f6883fbf1 move reparsers to grammar 2019-02-20 16:02:06 +03:00
Aleksey Kladov
5a6eda528c tighten visibility 2019-02-20 15:57:26 +03:00
Aleksey Kladov
5222b8aba3 move all parsing related bits to a separate module 2019-02-20 15:47:32 +03:00
Aleksey Kladov
9d0cda4bc8 slightly better name 2019-02-20 15:03:31 +03:00
Aleksey Kladov
df6efe62c5 make stuff private 2019-02-20 14:53:19 +03:00
Aleksey Kladov
4e8a3f565b handle != operator 2019-02-18 10:09:44 +03:00
Ville Penttinen
58d14bcaf7 Enable parsing attributes for generic lifetimes and type parameters 2019-02-17 23:32:10 +02:00
Ville Penttinen
bb25958705 Remove match_armlist validator 2019-02-17 20:32:10 +02:00
Ville Penttinen
96e3ac389f Parse only outer_attributes for match arms for now 2019-02-17 19:48:08 +02:00
Ville Penttinen
1c97c1ac11 Enable parsing of attributes inside a match block
We allow invalid inner attributes to be parsed, e.g. inner attributes that are
not directly after the opening brace of the match block.

Instead we run validation on `MatchArmList` to allow better reporting of errors.
2019-02-17 19:26:57 +02:00
Florian Diebold
a1bda3fc08 Handle generic args for method calls 2019-02-16 23:06:41 +01:00